Skip to content

Commit d31d913

Browse files
fix: cookies Key is case-sensitive
1 parent 3e38208 commit d31d913

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

end_to_end_tests/golden-record-custom/custom_e2e/api/tests/token_with_cookie_auth_token_with_cookie_get.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def _build_response(*, response: httpx.Response) -> Response[Union[None, None]]:
3131
def httpx_request(
3232
*,
3333
client: Client,
34-
token: str,
34+
my_token: str,
3535
) -> Response[Union[None, None]]:
3636

3737
response = client.request(

end_to_end_tests/golden-record/my_test_api_client/api/tests/token_with_cookie_auth_token_with_cookie_get.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
def _get_kwargs(
1010
*,
1111
client: Client,
12-
token: str,
12+
my_token: str,
1313
) -> Dict[str, Any]:
1414
url = "{}/auth/token_with_cookie".format(client.base_url)
1515

1616
headers: Dict[str, Any] = client.get_headers()
1717
cookies: Dict[str, Any] = client.get_cookies()
1818

19-
cookies["token"] = token
19+
cookies["MyToken"] = my_token
2020

2121
return {
2222
"url": url,
@@ -50,11 +50,11 @@ def _build_response(*, response: httpx.Response) -> Response[Union[None, None]]:
5050
def sync_detailed(
5151
*,
5252
client: Client,
53-
token: str,
53+
my_token: str,
5454
) -> Response[Union[None, None]]:
5555
kwargs = _get_kwargs(
5656
client=client,
57-
token=token,
57+
my_token=my_token,
5858
)
5959

6060
response = httpx.get(
@@ -67,24 +67,24 @@ def sync_detailed(
6767
def sync(
6868
*,
6969
client: Client,
70-
token: str,
70+
my_token: str,
7171
) -> Optional[Union[None, None]]:
7272
""" Test optional cookie parameters """
7373

7474
return sync_detailed(
7575
client=client,
76-
token=token,
76+
my_token=my_token,
7777
).parsed
7878

7979

8080
async def asyncio_detailed(
8181
*,
8282
client: Client,
83-
token: str,
83+
my_token: str,
8484
) -> Response[Union[None, None]]:
8585
kwargs = _get_kwargs(
8686
client=client,
87-
token=token,
87+
my_token=my_token,
8888
)
8989

9090
async with httpx.AsyncClient() as _client:
@@ -96,13 +96,13 @@ async def asyncio_detailed(
9696
async def asyncio(
9797
*,
9898
client: Client,
99-
token: str,
99+
my_token: str,
100100
) -> Optional[Union[None, None]]:
101101
""" Test optional cookie parameters """
102102

103103
return (
104104
await asyncio_detailed(
105105
client=client,
106-
token=token,
106+
my_token=my_token,
107107
)
108108
).parsed

end_to_end_tests/openapi.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@
648648
"title": "Token",
649649
"type": "string"
650650
},
651-
"name": "token",
651+
"name": "MyToken",
652652
"in": "cookie"
653653
}
654654
],

openapi_python_client/templates/endpoint_macros.py.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if {{ parameter.python_name }} is not UNSET:
1515
{% if endpoint.cookie_parameters %}
1616
{% for parameter in endpoint.cookie_parameters %}
1717
{% if parameter.required %}
18-
cookies["{{ parameter.python_name | kebabcase}}"] = {{ parameter.python_name }}
18+
cookies["{{ parameter.name}}"] = {{ parameter.python_name }}
1919
{% else %}
2020
if {{ parameter.python_name }} is not UNSET:
2121
cookies["{{ parameter.python_name | kebabcase}}"] = {{ parameter.python_name }}

0 commit comments

Comments
 (0)