Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 58 for Optional (0.24 sec)

  1. fastapi/applications.py

            response_model: Any = Default(None),
            status_code: Optional[int] = None,
            tags: Optional[List[Union[str, Enum]]] = None,
            dependencies: Optional[Sequence[Depends]] = None,
            summary: Optional[str] = None,
            description: Optional[str] = None,
            response_description: str = "Successful Response",
            responses: Optional[Dict[Union[int, str], Dict[str, Any]]] = None,
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 172.2K bytes
    - Viewed (0)
  2. tests/test_skip_defaults.py

    from typing import Optional
    
    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class SubModel(BaseModel):
        a: Optional[str] = "foo"
    
    
    class Model(BaseModel):
        x: Optional[int] = None
        sub: SubModel
    
    
    class ModelSubclass(Model):
        y: int
        z: int = 0
        w: Optional[int] = None
    
    
    class ModelDefaults(BaseModel):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 2K bytes
    - Viewed (0)
  3. docs_src/separate_openapi_schemas/tutorial002_py39.py

    from typing import Optional
    
    from fastapi import FastAPI
    from pydantic import BaseModel
    
    
    class Item(BaseModel):
        name: str
        description: Optional[str] = None
    
    
    app = FastAPI(separate_input_output_schemas=False)
    
    
    @app.post("/items/")
    def create_item(item: Item):
        return item
    
    
    @app.get("/items/")
    def read_items() -> list[Item]:
        return [
            Item(
                name="Portal Gun",
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Aug 25 19:10:22 GMT 2023
    - 518 bytes
    - Viewed (0)
  4. tests/test_security_oauth2_authorization_code_bearer_description.py

    from typing import Optional
    
    from fastapi import FastAPI, Security
    from fastapi.security import OAuth2AuthorizationCodeBearer
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    oauth2_scheme = OAuth2AuthorizationCodeBearer(
        authorizationUrl="authorize",
        tokenUrl="token",
        description="OAuth2 Code Bearer",
        auto_error=True,
    )
    
    
    @app.get("/items/")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.4K bytes
    - Viewed (0)
  5. fastapi/routing.py

            response_model: Any = Default(None),
            status_code: Optional[int] = None,
            tags: Optional[List[Union[str, Enum]]] = None,
            dependencies: Optional[Sequence[params.Depends]] = None,
            summary: Optional[str] = None,
            description: Optional[str] = None,
            response_description: str = "Successful Response",
            responses: Optional[Dict[Union[int, str], Dict[str, Any]]] = None,
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 170.1K bytes
    - Viewed (0)
  6. fastapi/security/open_id_connect_url.py

                ),
            ],
            scheme_name: Annotated[
                Optional[str],
                Doc(
                    """
                    Security scheme name.
    
                    It will be included in the generated OpenAPI (e.g. visible at `/docs`).
                    """
                ),
            ] = None,
            description: Annotated[
                Optional[str],
                Doc(
                    """
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 2.7K bytes
    - Viewed (0)
  7. fastapi/openapi/docs.py

            ),
        ] = "https://fastapi.tiangolo.com/img/favicon.png",
        oauth2_redirect_url: Annotated[
            Optional[str],
            Doc(
                """
                The OAuth2 redirect URL, it is normally automatically handled by FastAPI.
                """
            ),
        ] = None,
        init_oauth: Annotated[
            Optional[Dict[str, Any]],
            Doc(
                """
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 10.1K bytes
    - Viewed (0)
  8. tests/test_sub_callbacks.py

    from typing import Optional
    
    from dirty_equals import IsDict
    from fastapi import APIRouter, FastAPI
    from fastapi.testclient import TestClient
    from pydantic import BaseModel, HttpUrl
    
    app = FastAPI()
    
    
    class Invoice(BaseModel):
        id: str
        title: Optional[str] = None
        customer: str
        total: float
    
    
    class InvoiceEvent(BaseModel):
        description: str
        paid: bool
    
    
    class InvoiceEventReceived(BaseModel):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 13.8K bytes
    - Viewed (0)
  9. tests/test_infer_param_optionality.py

    @item_router.get("/")
    def get_items(user_id: Optional[str] = None):
        if user_id is None:
            return [{"item_id": "i1", "user_id": "u1"}, {"item_id": "i2", "user_id": "u2"}]
        else:
            return [{"item_id": "i2", "user_id": user_id}]
    
    
    @item_router.get("/{item_id}")
    def get_item(item_id: str, user_id: Optional[str] = None):
        if user_id is None:
            return {"item_id": item_id}
        else:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 13.3K bytes
    - Viewed (0)
  10. fastapi/datastructures.py

            BinaryIO,
            Doc("The standard Python file object (non-async)."),
        ]
        filename: Annotated[Optional[str], Doc("The original file name.")]
        size: Annotated[Optional[int], Doc("The size of the file in bytes.")]
        headers: Annotated[Headers, Doc("The headers of the request.")]
        content_type: Annotated[
            Optional[str], Doc("The content type of the request, from the headers.")
        ]
    
        async def write(
            self,
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 5.6K bytes
    - Viewed (0)
Back to top