🎨 [pre-commit.ci] Auto format from pre-commit.com hooks

This commit is contained in:
pre-commit-ci[bot] 2024-02-24 14:08:38 +00:00
parent 953e0954fb
commit 85512b901d
2 changed files with 16 additions and 13 deletions

View File

@ -126,7 +126,10 @@ def get_openapi_operation_parameters(
parameter["examples"] = jsonable_encoder(field_info.examples)
else:
parameter["examples"] = jsonable_encoder(
[{"value": item, "summary": item} for item in field_info.examples]
[
{"value": item, "summary": item}
for item in field_info.examples
]
)
if field_info.example != Undefined:
parameter["example"] = jsonable_encoder(field_info.example)

View File

@ -479,13 +479,13 @@ def test_openapi_schema():
"title": "Item Id",
"type": "string",
"examples": ["item_1", "item_2"],
},
},
"name": "item_id",
"in": "path",
"in": "path",
"examples": [
{"value": "item_1", "summary": "item_1"},
{"value": "item_2", "summary": "item_2"},
],
],
}
],
"responses": {
@ -511,7 +511,7 @@ def test_openapi_schema():
"summary": "Path Example Examples",
"operationId": "path_example_examples_path_example_examples__item_id__get",
"parameters": [
{
{
"required": True,
"schema": {
"title": "Item Id",
@ -520,11 +520,11 @@ def test_openapi_schema():
},
"example": "item_overridden",
"name": "item_id",
"in": "path",
"in": "path",
"examples": [
{"value": "item_1", "summary": "item_1"},
{"value": "item_2", "summary": "item_2"},
],
],
}
],
"responses": {
@ -612,7 +612,7 @@ def test_openapi_schema():
"examples": [
{"value": "query1", "summary": "query1"},
{"value": "query2", "summary": "query2"},
],
],
}
],
"responses": {
@ -661,7 +661,7 @@ def test_openapi_schema():
"examples": [
{"value": "query1", "summary": "query1"},
{"value": "query2", "summary": "query2"},
],
],
}
],
"responses": {
@ -749,7 +749,7 @@ def test_openapi_schema():
"examples": [
{"value": "header1", "summary": "header1"},
{"value": "header2", "summary": "header2"},
],
],
}
],
"responses": {
@ -798,7 +798,7 @@ def test_openapi_schema():
"examples": [
{"value": "header1", "summary": "header1"},
{"value": "header2", "summary": "header2"},
],
],
}
],
"responses": {
@ -886,7 +886,7 @@ def test_openapi_schema():
"examples": [
{"value": "cookie1", "summary": "cookie1"},
{"value": "cookie2", "summary": "cookie2"},
],
],
}
],
"responses": {
@ -935,7 +935,7 @@ def test_openapi_schema():
"examples": [
{"value": "cookie1", "summary": "cookie1"},
{"value": "cookie2", "summary": "cookie2"},
],
],
}
],
"responses": {