Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 17 for json_schema_extra (3.08 sec)

  1. fastapi/params.py

                deprecated=deprecated,
                example=example,
                examples=examples,
                openapi_examples=openapi_examples,
                include_in_schema=include_in_schema,
                json_schema_extra=json_schema_extra,
                **extra,
            )
    
    
    class Query(Param):  # type: ignore[misc]
        in_ = ParamTypes.query
    
        def __init__(
            self,
            default: Any = Undefined,
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 26.3K bytes
    - Viewed (0)
  2. fastapi/param_functions.py

            example=example,
            examples=examples,
            openapi_examples=openapi_examples,
            deprecated=deprecated,
            include_in_schema=include_in_schema,
            json_schema_extra=json_schema_extra,
            **extra,
        )
    
    
    def Query(  # noqa: N802
        default: Annotated[
            Any,
            Doc(
                """
                Default value if the parameter field is not set.
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 63K bytes
    - Viewed (0)
  3. docs_src/schema_extra_example/tutorial001_py310.py

    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: str | None = None
        price: float
        tax: float | None = None
    
        model_config = {
            "json_schema_extra": {
                "examples": [
                    {
                        "name": "Foo",
                        "description": "A very nice Item",
                        "price": 35.4,
                        "tax": 3.2,
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 646 bytes
    - Viewed (0)
  4. docs_src/schema_extra_example/tutorial001_py39.py

    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: Union[str, None] = None
        price: float
        tax: Union[float, None] = None
    
        model_config = {
            "json_schema_extra": {
                "examples": [
                    {
                        "name": "Foo",
                        "description": "A very nice Item",
                        "price": 35.4,
                        "tax": 3.2,
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 684 bytes
    - Viewed (0)
  5. tests/test_custom_schema_fields.py

    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
    
        description: Annotated[
            Optional[str], WithJsonSchema({"type": ["string", "null"]})
        ] = None
    
        model_config = {
            "json_schema_extra": {
                "x-something-internal": {"level": 4},
            }
        }
    
    
    @app.get("/foo", response_model=Item)
    def foo():
        return {"name": "Foo item"}
    
    
    client = TestClient(app)
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 20 15:55:38 UTC 2025
    - 1.3K bytes
    - Viewed (0)
  6. tests/test_response_by_alias.py

    app = FastAPI()
    
    
    class Model(BaseModel):
        name: str = Field(alias="alias")
    
    
    class ModelNoAlias(BaseModel):
        name: str
    
        model_config = ConfigDict(
            json_schema_extra={
                "description": (
                    "response_model_by_alias=False is basically a quick hack, to support "
                    "proper OpenAPI use another model with the correct field names"
                )
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 20 15:55:38 UTC 2025
    - 10.7K bytes
    - Viewed (0)
  7. fastapi/security/oauth2.py

                    `username`.
                    """
                ),
            ],
            password: Annotated[
                str,
                Form(json_schema_extra={"format": "password"}),
                Doc(
                    """
                    `password` string. The OAuth2 spec requires the exact field name
                    `password`.
                    """
                ),
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 22K bytes
    - Viewed (0)
  8. docs/en/docs/tutorial/schema-extra-example.md

    You can use the attribute `model_config` that takes a `dict` as described in <a href="https://docs.pydantic.dev/latest/api/config/" class="external-link" target="_blank">Pydantic's docs: Configuration</a>.
    
    You can set `"json_schema_extra"` with a `dict` containing any additional data you would like to show up in the generated JSON Schema, including `examples`.
    
    /// tip
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 20 15:55:38 UTC 2025
    - 8.9K bytes
    - Viewed (0)
  9. docs/ru/docs/tutorial/schema-extra-example.md

    Вы можете задать `"json_schema_extra"` с `dict`, содержащим любые дополнительные данные, которые вы хотите видеть в сгенерированной JSON Schema, включая `examples`.
    
    ////
    
    //// tab | Pydantic v1
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Sep 30 11:24:39 UTC 2025
    - 14.8K bytes
    - Viewed (0)
  10. docs/de/docs/tutorial/schema-extra-example.md

    Sie können `json_schema_extra` setzen, mit einem `dict`, das alle zusätzlichen Daten enthält, die im generierten JSON-Schema angezeigt werden sollen, einschließlich `examples`.
    
    /// tip | Tipp
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 24 10:28:19 UTC 2025
    - 10.6K bytes
    - Viewed (0)
Back to top