From e899edef4a3ab5eba5cdf0c1853d83faafefbd30 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 22 Nov 2023 03:13:48 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20[pre-commit.ci]=20Auto=20format?= =?UTF-8?q?=20from=20pre-commit.com=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastapi/openapi/utils.py | 2 +- tests/test_application.py | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/fastapi/openapi/utils.py b/fastapi/openapi/utils.py index 6c4a1bd7f..ac8f76149 100644 --- a/fastapi/openapi/utils.py +++ b/fastapi/openapi/utils.py @@ -197,7 +197,7 @@ def get_openapi_operation_metadata( operation["description"] = route.description operation_id = route.operation_id or route.unique_id if len(route.methods) > 1: - operation_id = f'{operation_id}_{method.lower()}' + operation_id = f"{operation_id}_{method.lower()}" if operation_id in operation_ids: message = ( f"Duplicate Operation ID {operation_id} for function " diff --git a/tests/test_application.py b/tests/test_application.py index 311ceaa85..67f07e51d 100644 --- a/tests/test_application.py +++ b/tests/test_application.py @@ -1170,9 +1170,9 @@ def test_openapi_schema(): "responses": { "200": { "description": "Successful Response", - "content": {"application/json": {"schema": {}}} + "content": {"application/json": {"schema": {}}}, } - } + }, }, "post": { "summary": "Multiple Methods", @@ -1180,15 +1180,11 @@ def test_openapi_schema(): "responses": { "200": { "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } + "content": {"application/json": {"schema": {}}}, } - } - } - } + }, + }, + }, }, "components": { "schemas": {