📝 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:
Nils Lindemann
2024-04-19 02:11:40 +02:00
committed by GitHub
parent d84d6e03f4
commit 6d523d62d0
10 changed files with 95 additions and 215 deletions

View File

@@ -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",

View File

@@ -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",

View File

@@ -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",

View File

@@ -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",

View File

@@ -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",