Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 1 of 1 for FormModel (0.06 seconds)

  1. tests/test_forms_single_model.py

    app = FastAPI()
    
    
    class FormModel(BaseModel):
        username: str
        lastname: str
        age: int | None = None
        tags: list[str] = ["foo", "bar"]
        alias_with: str = Field(alias="with", default="nothing")
    
    
    class FormModelExtraAllow(BaseModel):
        param: str
    
        model_config = {"extra": "allow"}
    
    
    @app.post("/form/")
    def post_form(user: Annotated[FormModel, Form()]):
        return user
    
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 3.4K bytes
    - Click Count (0)
Back to Top