Browse Source

🎨 Auto format

pull/14575/head
github-actions[bot] 7 months ago
parent
commit
2ead760afd
  1. 1
      docs/en/docs/how-to/separate-openapi-schemas.md
  2. 4
      docs/en/docs/tutorial/extra-models.md
  3. 1
      fastapi/routing.py
  4. 12
      tests/test_pydantic_v1_v2_mixed.py
  5. 28
      tests/test_pydantic_v1_v2_noneable.py

1
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
<div class="screenshot">
<img src="/img/tutorial/separate-openapi-schemas/image05.png">
</div>

4
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`.

1
fastapi/routing.py

@ -1,4 +1,3 @@
import dataclasses
import email.message
import functools
import inspect

12
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,

28
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"},

Loading…
Cancel
Save