Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 2 of 2 for optional_str (0.09 seconds)

  1. tests/test_request_params/test_form/test_optional_str.py

    from .utils import get_body_model_name
    
    app = FastAPI()
    
    # =====================================================================================
    # Without aliases
    
    
    @app.post("/optional-str", operation_id="optional_str")
    async def read_optional_str(p: Annotated[str | None, Form()] = None):
        return {"p": p}
    
    
    class FormModelOptionalStr(BaseModel):
        p: str | None = None
    
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 8.9K bytes
    - Click Count (0)
  2. tests/test_request_params/test_body/test_optional_str.py

    from .utils import get_body_model_name
    
    app = FastAPI()
    
    # =====================================================================================
    # Without aliases
    
    
    @app.post("/optional-str", operation_id="optional_str")
    async def read_optional_str(p: Annotated[str | None, Body(embed=True)] = None):
        return {"p": p}
    
    
    class BodyModelOptionalStr(BaseModel):
        p: str | None = None
    
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 11.5K bytes
    - Click Count (0)
Back to Top