Skip to content

Commit

Permalink
chore: fix typos (#1740)
Browse files Browse the repository at this point in the history
Changes proposed in this pull request:

 - fix some minor typos
  • Loading branch information
afuetterer authored Oct 12, 2023
1 parent abc1da7 commit 8459c61
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion connexion/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down
2 changes: 1 addition & 1 deletion connexion/lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/request.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 13 additions & 13 deletions tests/api/test_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -445,17 +445,17 @@ 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",
json={"name": True},
)
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",
Expand Down
12 changes: 6 additions & 6 deletions tests/api/test_secure_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -107,17 +107,17 @@ 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"
)

headers = {"Authorization": "Bearer 300"}
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
Expand Down
2 changes: 1 addition & 1 deletion tests/fakeapi/hello/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"


Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/default_param_error/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/default_param_error/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8459c61

Please sign in to comment.