- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 23 for module_config (0.19 sec)
-
docs/en/docs/advanced/settings.md
=== "Pydantic v2" ```Python hl_lines="9" {!> ../../../docs_src/settings/app03_an/config.py!} ``` !!! tip The `model_config` attribute is used just for Pydantic configuration. You can read more at <a href="https://docs.pydantic.dev/latest/usage/model_config/" class="external-link" target="_blank">Pydantic Model Config</a>. === "Pydantic v1" ```Python hl_lines="9-10"
Registered: Mon Jun 17 08:32:26 UTC 2024 - Last Modified: Sat May 18 23:43:13 UTC 2024 - 15.7K bytes - Viewed (0) -
tests/test_additional_properties_bool.py
from fastapi import FastAPI from fastapi._compat import PYDANTIC_V2 from fastapi.testclient import TestClient from pydantic import BaseModel, ConfigDict class FooBaseModel(BaseModel): if PYDANTIC_V2: model_config = ConfigDict(extra="forbid") else: class Config: extra = "forbid" class Foo(FooBaseModel): pass app = FastAPI() @app.post("/") async def post(
Registered: Mon Jun 17 08:32:26 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 4.2K bytes - Viewed (0) -
tests/test_inherited_custom_class.py
assert type(asyncpg_uuid) != uuid.UUID with pytest.raises(TypeError): vars(asyncpg_uuid) return {"fast_uuid": asyncpg_uuid} class SomeCustomClass(BaseModel): model_config = {"arbitrary_types_allowed": True} a_uuid: MyUuid @field_serializer("a_uuid") def serialize_a_uuid(self, v): return str(v) @app.get("/get_custom_class")
Registered: Mon Jun 17 08:32:26 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 3K bytes - Viewed (0) -
tests/test_openapi_separate_input_output_schemas.py
sub_description: Optional[str] = None tags: List[str] = [] if PYDANTIC_V2: model_config = {"json_schema_serialization_defaults_required": True} class Item(BaseModel): name: str description: Optional[str] = None sub: Optional[SubItem] = None if PYDANTIC_V2: model_config = {"json_schema_serialization_defaults_required": True}
Registered: Mon Jun 17 08:32:26 UTC 2024 - Last Modified: Thu Sep 28 04:14:40 UTC 2023 - 18.4K bytes - Viewed (0) -
docs/en/docs/tutorial/schema-extra-example.md
Registered: Mon Jun 17 08:32:26 UTC 2024 - Last Modified: Thu Apr 18 19:53:19 UTC 2024 - 11.8K bytes - Viewed (0) -
docs/de/docs/advanced/settings.md
!!! info
Registered: Mon Jun 17 08:32:26 UTC 2024 - Last Modified: Sat Mar 30 20:17:14 UTC 2024 - 17.8K bytes - Viewed (0) -
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 "
Registered: Mon Jun 17 08:32:26 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 11.1K bytes - Viewed (0) -
docs/ko/docs/tutorial/schema-extra-example.md
``` 추가 정보는 있는 그대로 해당 모델의 **JSON 스키마** 결과에 추가되고, API 문서에서 사용합니다. === "Pydantic v2" 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"
Registered: Mon Jun 17 08:32:26 UTC 2024 - Last Modified: Fri Feb 09 12:35:46 UTC 2024 - 13.6K bytes - Viewed (0) -
docs/de/docs/tutorial/schema-extra-example.md
Diese zusätzlichen Informationen werden unverändert zum für dieses Modell ausgegebenen **JSON-Schema** hinzugefügt und in der API-Dokumentation verwendet. === "Pydantic v2" In Pydantic Version 2 würden Sie das Attribut `model_config` verwenden, das ein `dict` akzeptiert, wie beschrieben in <a href="https://docs.pydantic.dev/latest/api/config/" class="external-link" target="_blank">Pydantic-Dokumentation: Configuration</a>.
Registered: Mon Jun 17 08:32:26 UTC 2024 - Last Modified: Sat Mar 30 20:19:53 UTC 2024 - 13.3K bytes - Viewed (0) -
tests/test_schema_extra_examples.py
from pydantic import BaseModel, ConfigDict 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:
Registered: Mon Jun 17 08:32:26 UTC 2024 - Last Modified: Tue Oct 24 20:26:06 UTC 2023 - 37.7K bytes - Viewed (0)