From cef604199ddb1e9e92ca59e509497e547a2e6684 Mon Sep 17 00:00:00 2001 From: fbjorn Date: Fri, 19 Jul 2024 16:37:41 +0300 Subject: [PATCH] Fix naming --- definition_tooling/converter/converter.py | 4 +++- .../__snapshots__/test_converter/test_air_quality.json | 8 ++++---- .../test_converter/test_company_basic_info_errors.json | 8 ++++---- .../test_current_weather_required_headers.json | 8 ++++---- .../test_converter/test_teapot_deprecated.json | 8 ++++---- 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/definition_tooling/converter/converter.py b/definition_tooling/converter/converter.py index 1ea5588..c191b51 100644 --- a/definition_tooling/converter/converter.py +++ b/definition_tooling/converter/converter.py @@ -203,7 +203,9 @@ def request( x_authorization_provider: Optional[str] = Header( None, description="The bare domain of the system that provided the token." ), - x_api_token: Optional[str] = Header(None, description="API token"), + x_api_key: Optional[str] = Header( + None, description="API key or token", title="X-API-Token" + ), ): pass diff --git a/definition_tooling/converter/tests/__snapshots__/test_converter/test_air_quality.json b/definition_tooling/converter/tests/__snapshots__/test_converter/test_air_quality.json index ec30730..a0b47b9 100644 --- a/definition_tooling/converter/tests/__snapshots__/test_converter/test_air_quality.json +++ b/definition_tooling/converter/tests/__snapshots__/test_converter/test_air_quality.json @@ -333,9 +333,9 @@ } }, { - "description": "API token", + "description": "API key or token", "in": "header", - "name": "x-api-token", + "name": "x-api-key", "required": false, "schema": { "anyOf": [ @@ -346,8 +346,8 @@ "type": "null" } ], - "description": "API token", - "title": "X-Api-Token" + "description": "API key or token", + "title": "X-API-Token" } } ], diff --git a/definition_tooling/converter/tests/__snapshots__/test_converter/test_company_basic_info_errors.json b/definition_tooling/converter/tests/__snapshots__/test_converter/test_company_basic_info_errors.json index 87729f9..910ac43 100644 --- a/definition_tooling/converter/tests/__snapshots__/test_converter/test_company_basic_info_errors.json +++ b/definition_tooling/converter/tests/__snapshots__/test_converter/test_company_basic_info_errors.json @@ -287,9 +287,9 @@ } }, { - "description": "API token", + "description": "API key or token", "in": "header", - "name": "x-api-token", + "name": "x-api-key", "required": false, "schema": { "anyOf": [ @@ -300,8 +300,8 @@ "type": "null" } ], - "description": "API token", - "title": "X-Api-Token" + "description": "API key or token", + "title": "X-API-Token" } } ], diff --git a/definition_tooling/converter/tests/__snapshots__/test_converter/test_current_weather_required_headers.json b/definition_tooling/converter/tests/__snapshots__/test_converter/test_current_weather_required_headers.json index ec0f070..49910e1 100644 --- a/definition_tooling/converter/tests/__snapshots__/test_converter/test_current_weather_required_headers.json +++ b/definition_tooling/converter/tests/__snapshots__/test_converter/test_current_weather_required_headers.json @@ -348,9 +348,9 @@ } }, { - "description": "API token", + "description": "API key or token", "in": "header", - "name": "x-api-token", + "name": "x-api-key", "required": false, "schema": { "anyOf": [ @@ -361,8 +361,8 @@ "type": "null" } ], - "description": "API token", - "title": "X-Api-Token" + "description": "API key or token", + "title": "X-API-Token" } } ], diff --git a/definition_tooling/converter/tests/__snapshots__/test_converter/test_teapot_deprecated.json b/definition_tooling/converter/tests/__snapshots__/test_converter/test_teapot_deprecated.json index 68638fb..a5791ef 100644 --- a/definition_tooling/converter/tests/__snapshots__/test_converter/test_teapot_deprecated.json +++ b/definition_tooling/converter/tests/__snapshots__/test_converter/test_teapot_deprecated.json @@ -320,9 +320,9 @@ } }, { - "description": "API token", + "description": "API key or token", "in": "header", - "name": "x-api-token", + "name": "x-api-key", "required": false, "schema": { "anyOf": [ @@ -333,8 +333,8 @@ "type": "null" } ], - "description": "API token", - "title": "X-Api-Token" + "description": "API key or token", + "title": "X-API-Token" } } ],