Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for json_schema_extra (0.28 sec)

  1. fastapi/params.py

                        "strict": strict,
                        "json_schema_extra": current_json_schema_extra,
                    }
                )
                kwargs["pattern"] = pattern or regex
            else:
                kwargs["regex"] = pattern or regex
                kwargs.update(**current_json_schema_extra)
            use_kwargs = {k: v for k, v in kwargs.items() if v is not _Unset}
    
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 27.5K bytes
    - Viewed (1)
  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.
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 62.5K bytes
    - Viewed (0)
  3. docs_src/schema_extra_example/tutorial001.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,
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 684 bytes
    - Viewed (0)
  4. 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,
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 646 bytes
    - Viewed (0)
  5. tests/test_custom_schema_fields.py

    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
    
        if PYDANTIC_V2:
            model_config = {
                "json_schema_extra": {
                    "x-something-internal": {"level": 4},
                }
            }
        else:
    
            class Config:
                schema_extra = {
                    "x-something-internal": {"level": 4},
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 1.2K 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
    
        if PYDANTIC_V2:
            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"
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 11.1K bytes
    - Viewed (0)
  7. 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`.
    
    === "Pydantic v1"
    
    Plain Text
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:19:53 GMT 2024
    - 13.3K bytes
    - Viewed (0)
  8. docs/en/docs/tutorial/schema-extra-example.md

        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`.
    
    === "Pydantic v1"
    
    Plain Text
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 11.8K bytes
    - Viewed (0)
  9. docs/ko/docs/tutorial/schema-extra-example.md

        Pydantic 버전 2에서 <a href="https://docs.pydantic.dev/latest/usage/model_config/" class="external-link" target="_blank">Pydantic 공식 문서: Model Config</a>에 나와 있는 것처럼 `dict`를 받는 `model_config` 어트리뷰트를 사용할 것입니다.
    
        `"json_schema_extra"`를 생성된 JSON 스키마에서 보여주고 싶은 별도의 데이터와 `examples`를 포함하는 `dict`으로 설정할 수 있습니다.
    
    === "Pydantic v1"
    
    Plain Text
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Feb 09 12:35:46 GMT 2024
    - 13.6K bytes
    - Viewed (0)
  10. tests/test_schema_extra_examples.py

    
    def create_app():
        app = FastAPI()
    
        class Item(BaseModel):
            data: str
    
            if PYDANTIC_V2:
                model_config = ConfigDict(
                    json_schema_extra={"example": {"data": "Data in schema_extra"}}
                )
            else:
    
                class Config:
                    schema_extra = {"example": {"data": "Data in schema_extra"}}
    
        @app.post("/schema_extra/")
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 37.7K bytes
    - Viewed (0)
Back to top