diff --git a/docs/en/docs/how-to/separate-openapi-schemas.md b/docs/en/docs/how-to/separate-openapi-schemas.md index a640f3687..902cf060a 100644 --- a/docs/en/docs/how-to/separate-openapi-schemas.md +++ b/docs/en/docs/how-to/separate-openapi-schemas.md @@ -100,4 +100,3 @@ And now there will be one single schema for input and output for the model, only
- diff --git a/docs/en/docs/tutorial/extra-models.md b/docs/en/docs/tutorial/extra-models.md index b7be468d2..d82df561f 100644 --- a/docs/en/docs/tutorial/extra-models.md +++ b/docs/en/docs/tutorial/extra-models.md @@ -22,9 +22,9 @@ Here's a general idea of how the models could look like with their password fiel {* ../../docs_src/extra_models/tutorial001_py310.py hl[7,9,14,20,22,27:28,31:33,38:39] *} -### About `**user_in.model_dump()` { #about-user-in-dict } +### About `**user_in.model_dump()` { #about-user-in-model-dump } -#### Pydantic's `.model_dump()` { #pydantics-dict } +#### Pydantic's `.model_dump()` { #pydantics-model-dump } `user_in` is a Pydantic model of class `UserIn`. diff --git a/fastapi/routing.py b/fastapi/routing.py index 05e9b0bc1..d212e4e40 100644 --- a/fastapi/routing.py +++ b/fastapi/routing.py @@ -1,4 +1,3 @@ -import dataclasses import email.message import functools import inspect diff --git a/tests/test_pydantic_v1_v2_mixed.py b/tests/test_pydantic_v1_v2_mixed.py index 76928e473..61e5bb582 100644 --- a/tests/test_pydantic_v1_v2_mixed.py +++ b/tests/test_pydantic_v1_v2_mixed.py @@ -979,13 +979,11 @@ def test_openapi_schema(): "content": { "application/json": { "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/Item" - } - ], - "title": "Data", - } + "allOf": [ + {"$ref": "#/components/schemas/Item"} + ], + "title": "Data", + } } }, "required": True, diff --git a/tests/test_pydantic_v1_v2_noneable.py b/tests/test_pydantic_v1_v2_noneable.py index a712b439c..2cb6c3d6b 100644 --- a/tests/test_pydantic_v1_v2_noneable.py +++ b/tests/test_pydantic_v1_v2_noneable.py @@ -344,11 +344,11 @@ def test_v2_to_v1_nested_validation_error(): { "detail": [ { - "type": "missing", - "loc": ["body", "new_sub", "new_sub_name"], - "msg": "Field required", - "input": {"wrong_field": "value"}, - } + "type": "missing", + "loc": ["body", "new_sub", "new_sub_name"], + "msg": "Field required", + "input": {"wrong_field": "value"}, + } ] } ) @@ -444,13 +444,11 @@ def test_openapi_schema(): "content": { "application/json": { "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/Item" - } - ], - "title": "Data", - } + "allOf": [ + {"$ref": "#/components/schemas/Item"} + ], + "title": "Data", + } } }, "required": True, @@ -638,9 +636,9 @@ def test_openapi_schema(): "new_title": {"type": "string", "title": "New Title"}, "new_size": {"type": "integer", "title": "New Size"}, "new_description": { - "anyOf": [{"type": "string"}, {"type": "null"}], - "title": "New Description", - }, + "anyOf": [{"type": "string"}, {"type": "null"}], + "title": "New Description", + }, "new_sub": {"$ref": "#/components/schemas/NewSubItem"}, "new_multi": { "items": {"$ref": "#/components/schemas/NewSubItem"},