From e3d2f2d4d6c612351d68d95306d3a82f680bc92d Mon Sep 17 00:00:00 2001 From: Heinz-Alexander Fuetterer Date: Thu, 12 Oct 2023 19:10:31 +0200 Subject: [PATCH] chore: fix typos --- README.rst | 2 +- connexion/cli.py | 2 +- connexion/lifecycle.py | 2 +- docs/request.rst | 2 +- tests/api/test_responses.py | 26 +++++++++---------- tests/api/test_secure_api.py | 12 ++++----- tests/fakeapi/hello/__init__.py | 2 +- .../fixtures/default_param_error/openapi.yaml | 2 +- .../fixtures/default_param_error/swagger.yaml | 2 +- 9 files changed, 26 insertions(+), 26 deletions(-) diff --git a/README.rst b/README.rst index bdc2d6491..b70b71657 100644 --- a/README.rst +++ b/README.rst @@ -323,7 +323,7 @@ supports collection formats "pipes" and "csv". The default format is "csv". Connexion is opinionated about how the URI is parsed for ``array`` types. The default behavior for query parameters that have been defined multiple times is to use the right-most value. For example, if you provide a URI with -the the query string ``?letters=a,b,c&letters=d,e,f``, connexion will set +the query string ``?letters=a,b,c&letters=d,e,f``, connexion will set ``letters = ['d', 'e', 'f']``. You can override this behavior by specifying the URI parser in the app or diff --git a/connexion/cli.py b/connexion/cli.py index b25f8495b..f3f75c3bb 100644 --- a/connexion/cli.py +++ b/connexion/cli.py @@ -76,7 +76,7 @@ def main(): ) @click.option( "--hide-console-ui", - help="Hides the the API console UI which is by default available at `/ui`.", + help="Hides the API console UI which is by default available at `/ui`.", is_flag=True, default=False, ) diff --git a/connexion/lifecycle.py b/connexion/lifecycle.py index ca672b138..e002207e0 100644 --- a/connexion/lifecycle.py +++ b/connexion/lifecycle.py @@ -55,7 +55,7 @@ def json(self) -> dict: def get_body(self) -> t.Any: """Get body based on the content type. This returns json data for json content types, - form data for form content types, and bytes for all others. If the bytes data is emtpy, + form data for form content types, and bytes for all others. If the bytes data is empty, :code:`None` is returned instead.""" raise NotImplementedError diff --git a/docs/request.rst b/docs/request.rst index 61de0cf60..a10b36fe9 100644 --- a/docs/request.rst +++ b/docs/request.rst @@ -152,7 +152,7 @@ The default format is "csv". Connexion is opinionated about how the URI is parsed for ``array`` types. The default behavior for query parameters that have been defined multiple times is to join them all together. For example, if you provide a URI with -the the query string ``?letters=a,b,c&letters=d,e,f``, connexion will set +the query string ``?letters=a,b,c&letters=d,e,f``, connexion will set ``letters = ['a', 'b', 'c', 'd', 'e', 'f']``. You can override this behavior by specifying the URI parser in the app or diff --git a/tests/api/test_responses.py b/tests/api/test_responses.py index 2cfe517fd..f28a09e84 100644 --- a/tests/api/test_responses.py +++ b/tests/api/test_responses.py @@ -100,23 +100,23 @@ def test_jsonifier(simple_app): post_greeting = app_client.post("/v1.0/greeting/jsantos") assert post_greeting.status_code == 200 assert post_greeting.headers.get("content-type") == "application/json" - greeting_reponse = post_greeting.json() - assert greeting_reponse["greeting"] == "Hello jsantos" + greeting_response = post_greeting.json() + assert greeting_response["greeting"] == "Hello jsantos" get_list_greeting = app_client.get("/v1.0/list/jsantos") assert get_list_greeting.status_code == 200 assert get_list_greeting.headers.get("content-type") == "application/json" - greeting_reponse = get_list_greeting.json() - assert len(greeting_reponse) == 2 - assert greeting_reponse[0] == "hello" - assert greeting_reponse[1] == "jsantos" + greeting_response = get_list_greeting.json() + assert len(greeting_response) == 2 + assert greeting_response[0] == "hello" + assert greeting_response[1] == "jsantos" get_greetings = app_client.get("/v1.0/greetings/jsantos") assert get_greetings.status_code == 200 assert get_greetings.headers.get("content-type") == "application/x.connexion+json" - greetings_reponse = get_greetings.json() - assert len(greetings_reponse) == 1 - assert greetings_reponse["greetings"] == "Hello jsantos" + greetings_response = get_greetings.json() + assert len(greetings_response) == 1 + assert greetings_response["greetings"] == "Hello jsantos" def test_not_content_response(simple_app): @@ -445,8 +445,8 @@ def test_oneof(simple_openapi_app): ) assert post_greeting.status_code == 200 assert post_greeting.headers.get("content-type") == "application/json" - greeting_reponse = post_greeting.json() - assert greeting_reponse["greeting"] == "Hello 3" + greeting_response = post_greeting.json() + assert greeting_response["greeting"] == "Hello 3" post_greeting = app_client.post( "/v1.0/oneof_greeting", @@ -454,8 +454,8 @@ def test_oneof(simple_openapi_app): ) assert post_greeting.status_code == 200 assert post_greeting.headers.get("content-type") == "application/json" - greeting_reponse = post_greeting.json() - assert greeting_reponse["greeting"] == "Hello True" + greeting_response = post_greeting.json() + assert greeting_response["greeting"] == "Hello True" post_greeting = app_client.post( "/v1.0/oneof_greeting", diff --git a/tests/api/test_secure_api.py b/tests/api/test_secure_api.py index a966c7ed9..cf547965f 100644 --- a/tests/api/test_secure_api.py +++ b/tests/api/test_secure_api.py @@ -95,8 +95,8 @@ def test_security(oauth_requests, secure_endpoint_app): get_bye_no_auth = app_client.get("/v1.0/byesecure/jsantos") assert get_bye_no_auth.status_code == 401 assert get_bye_no_auth.headers.get("content-type") == "application/problem+json" - get_bye_no_auth_reponse = get_bye_no_auth.json() - assert get_bye_no_auth_reponse["detail"] == "No authorization token provided" + get_bye_no_auth_response = get_bye_no_auth.json() + assert get_bye_no_auth_response["detail"] == "No authorization token provided" headers = {"Authorization": "Bearer 100"} get_bye_good_auth = app_client.get("/v1.0/byesecure/jsantos", headers=headers) @@ -107,8 +107,8 @@ def test_security(oauth_requests, secure_endpoint_app): get_bye_wrong_scope = app_client.get("/v1.0/byesecure/jsantos", headers=headers) assert get_bye_wrong_scope.status_code == 403 assert get_bye_wrong_scope.headers.get("content-type") == "application/problem+json" - get_bye_wrong_scope_reponse = get_bye_wrong_scope.json() - assert get_bye_wrong_scope_reponse["detail"].startswith( + get_bye_wrong_scope_response = get_bye_wrong_scope.json() + assert get_bye_wrong_scope_response["detail"].startswith( "Provided token does not have the required scope" ) @@ -116,8 +116,8 @@ def test_security(oauth_requests, secure_endpoint_app): get_bye_bad_token = app_client.get("/v1.0/byesecure/jsantos", headers=headers) assert get_bye_bad_token.status_code == 401 assert get_bye_bad_token.headers.get("content-type") == "application/problem+json" - get_bye_bad_token_reponse = get_bye_bad_token.json() - assert get_bye_bad_token_reponse["detail"] == "Provided token is not valid" + get_bye_bad_token_response = get_bye_bad_token.json() + assert get_bye_bad_token_response["detail"] == "Provided token is not valid" response = app_client.get("/v1.0/more-than-one-security-definition") assert response.status_code == 401 diff --git a/tests/fakeapi/hello/__init__.py b/tests/fakeapi/hello/__init__.py index ad0d6ffed..b92347112 100644 --- a/tests/fakeapi/hello/__init__.py +++ b/tests/fakeapi/hello/__init__.py @@ -433,7 +433,7 @@ def path_parameters_in_get_method(title): return [title], 200, {} -def test_default_missmatch_definition(age): +def test_default_mismatch_definition(age): return "OK" diff --git a/tests/fixtures/default_param_error/openapi.yaml b/tests/fixtures/default_param_error/openapi.yaml index 6fd1e10cd..e3d768af0 100644 --- a/tests/fixtures/default_param_error/openapi.yaml +++ b/tests/fixtures/default_param_error/openapi.yaml @@ -6,7 +6,7 @@ paths: /default-param-query-does-not-match-type: get: summary: Default value does not match the param type - operationId: fakeapi.hello.test_default_missmatch_definition + operationId: fakeapi.hello.test_default_mismatch_definition responses: '200': description: OK diff --git a/tests/fixtures/default_param_error/swagger.yaml b/tests/fixtures/default_param_error/swagger.yaml index b5532ad5f..f0ee7ed7e 100644 --- a/tests/fixtures/default_param_error/swagger.yaml +++ b/tests/fixtures/default_param_error/swagger.yaml @@ -10,7 +10,7 @@ paths: /default-param-query-does-not-match-type: get: summary: Default value does not match the param type - operationId: fakeapi.hello.test_default_missmatch_definition + operationId: fakeapi.hello.test_default_mismatch_definition responses: 200: description: OK