mirror of
https://github.com/fastapi/fastapi.git
synced 2026-05-18 13:27:45 -04:00
📝 Fix types in examples under docs_src/extra_data_types (#10535)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
This commit is contained in:
@@ -67,6 +67,7 @@ def test_openapi_schema():
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"required": True,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": IsDict(
|
||||
@@ -86,7 +87,7 @@ def test_openapi_schema():
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -97,40 +98,16 @@ def test_openapi_schema():
|
||||
"title": "Body_read_items_items__item_id__put",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"start_datetime": IsDict(
|
||||
{
|
||||
"title": "Start Datetime",
|
||||
"anyOf": [
|
||||
{"type": "string", "format": "date-time"},
|
||||
{"type": "null"},
|
||||
],
|
||||
}
|
||||
)
|
||||
| IsDict(
|
||||
# TODO: remove when deprecating Pydantic v1
|
||||
{
|
||||
"title": "Start Datetime",
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
}
|
||||
),
|
||||
"end_datetime": IsDict(
|
||||
{
|
||||
"title": "End Datetime",
|
||||
"anyOf": [
|
||||
{"type": "string", "format": "date-time"},
|
||||
{"type": "null"},
|
||||
],
|
||||
}
|
||||
)
|
||||
| IsDict(
|
||||
# TODO: remove when deprecating Pydantic v1
|
||||
{
|
||||
"title": "End Datetime",
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
}
|
||||
),
|
||||
"start_datetime": {
|
||||
"title": "Start Datetime",
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
},
|
||||
"end_datetime": {
|
||||
"title": "End Datetime",
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
},
|
||||
"repeat_at": IsDict(
|
||||
{
|
||||
"title": "Repeat At",
|
||||
@@ -151,10 +128,8 @@ def test_openapi_schema():
|
||||
"process_after": IsDict(
|
||||
{
|
||||
"title": "Process After",
|
||||
"anyOf": [
|
||||
{"type": "string", "format": "duration"},
|
||||
{"type": "null"},
|
||||
],
|
||||
"type": "string",
|
||||
"format": "duration",
|
||||
}
|
||||
)
|
||||
| IsDict(
|
||||
@@ -166,6 +141,7 @@ def test_openapi_schema():
|
||||
}
|
||||
),
|
||||
},
|
||||
"required": ["start_datetime", "end_datetime", "process_after"],
|
||||
},
|
||||
"ValidationError": {
|
||||
"title": "ValidationError",
|
||||
|
||||
@@ -67,6 +67,7 @@ def test_openapi_schema():
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"required": True,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": IsDict(
|
||||
@@ -86,7 +87,7 @@ def test_openapi_schema():
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -97,40 +98,16 @@ def test_openapi_schema():
|
||||
"title": "Body_read_items_items__item_id__put",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"start_datetime": IsDict(
|
||||
{
|
||||
"title": "Start Datetime",
|
||||
"anyOf": [
|
||||
{"type": "string", "format": "date-time"},
|
||||
{"type": "null"},
|
||||
],
|
||||
}
|
||||
)
|
||||
| IsDict(
|
||||
# TODO: remove when deprecating Pydantic v1
|
||||
{
|
||||
"title": "Start Datetime",
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
}
|
||||
),
|
||||
"end_datetime": IsDict(
|
||||
{
|
||||
"title": "End Datetime",
|
||||
"anyOf": [
|
||||
{"type": "string", "format": "date-time"},
|
||||
{"type": "null"},
|
||||
],
|
||||
}
|
||||
)
|
||||
| IsDict(
|
||||
# TODO: remove when deprecating Pydantic v1
|
||||
{
|
||||
"title": "End Datetime",
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
}
|
||||
),
|
||||
"start_datetime": {
|
||||
"title": "Start Datetime",
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
},
|
||||
"end_datetime": {
|
||||
"title": "End Datetime",
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
},
|
||||
"repeat_at": IsDict(
|
||||
{
|
||||
"title": "Repeat At",
|
||||
@@ -151,10 +128,8 @@ def test_openapi_schema():
|
||||
"process_after": IsDict(
|
||||
{
|
||||
"title": "Process After",
|
||||
"anyOf": [
|
||||
{"type": "string", "format": "duration"},
|
||||
{"type": "null"},
|
||||
],
|
||||
"type": "string",
|
||||
"format": "duration",
|
||||
}
|
||||
)
|
||||
| IsDict(
|
||||
@@ -166,6 +141,7 @@ def test_openapi_schema():
|
||||
}
|
||||
),
|
||||
},
|
||||
"required": ["start_datetime", "end_datetime", "process_after"],
|
||||
},
|
||||
"ValidationError": {
|
||||
"title": "ValidationError",
|
||||
|
||||
@@ -76,6 +76,7 @@ def test_openapi_schema(client: TestClient):
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"required": True,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": IsDict(
|
||||
@@ -95,7 +96,7 @@ def test_openapi_schema(client: TestClient):
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -106,40 +107,16 @@ def test_openapi_schema(client: TestClient):
|
||||
"title": "Body_read_items_items__item_id__put",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"start_datetime": IsDict(
|
||||
{
|
||||
"title": "Start Datetime",
|
||||
"anyOf": [
|
||||
{"type": "string", "format": "date-time"},
|
||||
{"type": "null"},
|
||||
],
|
||||
}
|
||||
)
|
||||
| IsDict(
|
||||
# TODO: remove when deprecating Pydantic v1
|
||||
{
|
||||
"title": "Start Datetime",
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
}
|
||||
),
|
||||
"end_datetime": IsDict(
|
||||
{
|
||||
"title": "End Datetime",
|
||||
"anyOf": [
|
||||
{"type": "string", "format": "date-time"},
|
||||
{"type": "null"},
|
||||
],
|
||||
}
|
||||
)
|
||||
| IsDict(
|
||||
# TODO: remove when deprecating Pydantic v1
|
||||
{
|
||||
"title": "End Datetime",
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
}
|
||||
),
|
||||
"start_datetime": {
|
||||
"title": "Start Datetime",
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
},
|
||||
"end_datetime": {
|
||||
"title": "End Datetime",
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
},
|
||||
"repeat_at": IsDict(
|
||||
{
|
||||
"title": "Repeat At",
|
||||
@@ -160,10 +137,8 @@ def test_openapi_schema(client: TestClient):
|
||||
"process_after": IsDict(
|
||||
{
|
||||
"title": "Process After",
|
||||
"anyOf": [
|
||||
{"type": "string", "format": "duration"},
|
||||
{"type": "null"},
|
||||
],
|
||||
"type": "string",
|
||||
"format": "duration",
|
||||
}
|
||||
)
|
||||
| IsDict(
|
||||
@@ -175,6 +150,7 @@ def test_openapi_schema(client: TestClient):
|
||||
}
|
||||
),
|
||||
},
|
||||
"required": ["start_datetime", "end_datetime", "process_after"],
|
||||
},
|
||||
"ValidationError": {
|
||||
"title": "ValidationError",
|
||||
|
||||
@@ -76,6 +76,7 @@ def test_openapi_schema(client: TestClient):
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"required": True,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": IsDict(
|
||||
@@ -95,7 +96,7 @@ def test_openapi_schema(client: TestClient):
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -106,40 +107,16 @@ def test_openapi_schema(client: TestClient):
|
||||
"title": "Body_read_items_items__item_id__put",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"start_datetime": IsDict(
|
||||
{
|
||||
"title": "Start Datetime",
|
||||
"anyOf": [
|
||||
{"type": "string", "format": "date-time"},
|
||||
{"type": "null"},
|
||||
],
|
||||
}
|
||||
)
|
||||
| IsDict(
|
||||
# TODO: remove when deprecating Pydantic v1
|
||||
{
|
||||
"title": "Start Datetime",
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
}
|
||||
),
|
||||
"end_datetime": IsDict(
|
||||
{
|
||||
"title": "End Datetime",
|
||||
"anyOf": [
|
||||
{"type": "string", "format": "date-time"},
|
||||
{"type": "null"},
|
||||
],
|
||||
}
|
||||
)
|
||||
| IsDict(
|
||||
# TODO: remove when deprecating Pydantic v1
|
||||
{
|
||||
"title": "End Datetime",
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
}
|
||||
),
|
||||
"start_datetime": {
|
||||
"title": "Start Datetime",
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
},
|
||||
"end_datetime": {
|
||||
"title": "End Datetime",
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
},
|
||||
"repeat_at": IsDict(
|
||||
{
|
||||
"title": "Repeat At",
|
||||
@@ -160,10 +137,8 @@ def test_openapi_schema(client: TestClient):
|
||||
"process_after": IsDict(
|
||||
{
|
||||
"title": "Process After",
|
||||
"anyOf": [
|
||||
{"type": "string", "format": "duration"},
|
||||
{"type": "null"},
|
||||
],
|
||||
"type": "string",
|
||||
"format": "duration",
|
||||
}
|
||||
)
|
||||
| IsDict(
|
||||
@@ -175,6 +150,7 @@ def test_openapi_schema(client: TestClient):
|
||||
}
|
||||
),
|
||||
},
|
||||
"required": ["start_datetime", "end_datetime", "process_after"],
|
||||
},
|
||||
"ValidationError": {
|
||||
"title": "ValidationError",
|
||||
|
||||
@@ -76,6 +76,7 @@ def test_openapi_schema(client: TestClient):
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"required": True,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": IsDict(
|
||||
@@ -95,7 +96,7 @@ def test_openapi_schema(client: TestClient):
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -106,40 +107,16 @@ def test_openapi_schema(client: TestClient):
|
||||
"title": "Body_read_items_items__item_id__put",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"start_datetime": IsDict(
|
||||
{
|
||||
"title": "Start Datetime",
|
||||
"anyOf": [
|
||||
{"type": "string", "format": "date-time"},
|
||||
{"type": "null"},
|
||||
],
|
||||
}
|
||||
)
|
||||
| IsDict(
|
||||
# TODO: remove when deprecating Pydantic v1
|
||||
{
|
||||
"title": "Start Datetime",
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
}
|
||||
),
|
||||
"end_datetime": IsDict(
|
||||
{
|
||||
"title": "End Datetime",
|
||||
"anyOf": [
|
||||
{"type": "string", "format": "date-time"},
|
||||
{"type": "null"},
|
||||
],
|
||||
}
|
||||
)
|
||||
| IsDict(
|
||||
# TODO: remove when deprecating Pydantic v1
|
||||
{
|
||||
"title": "End Datetime",
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
}
|
||||
),
|
||||
"start_datetime": {
|
||||
"title": "Start Datetime",
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
},
|
||||
"end_datetime": {
|
||||
"title": "End Datetime",
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
},
|
||||
"repeat_at": IsDict(
|
||||
{
|
||||
"title": "Repeat At",
|
||||
@@ -160,10 +137,8 @@ def test_openapi_schema(client: TestClient):
|
||||
"process_after": IsDict(
|
||||
{
|
||||
"title": "Process After",
|
||||
"anyOf": [
|
||||
{"type": "string", "format": "duration"},
|
||||
{"type": "null"},
|
||||
],
|
||||
"type": "string",
|
||||
"format": "duration",
|
||||
}
|
||||
)
|
||||
| IsDict(
|
||||
@@ -175,6 +150,7 @@ def test_openapi_schema(client: TestClient):
|
||||
}
|
||||
),
|
||||
},
|
||||
"required": ["start_datetime", "end_datetime", "process_after"],
|
||||
},
|
||||
"ValidationError": {
|
||||
"title": "ValidationError",
|
||||
|
||||
Reference in New Issue
Block a user