Skip to content

Commit 656e9af

Browse files
committed
Merge remote-tracking branch 'upstream/main' into case_sensitive_enum_values
2 parents 0ca0d78 + 47cfdec commit 656e9af

File tree

59 files changed

+364
-91
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+364
-91
lines changed

Diff for: .github/renovate.json

+23-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,27 @@
33
"config:base",
44
":semanticCommitTypeAll(chore)"
55
],
6-
"rangeStrategy": "widen"
6+
"rangeStrategy": "widen",
7+
"regexManagers": [
8+
{
9+
"fileMatch": [
10+
"release.*\\.yml"
11+
],
12+
"matchStrings": [
13+
"version:\\s*(?<currentValue>.*)"
14+
],
15+
"depNameTemplate": "knope",
16+
"datasourceTemplate": "crate",
17+
"versioningTemplate": "semver"
18+
}
19+
],
20+
"packageRules": [
21+
{
22+
"packagePatterns": [
23+
"^knope$"
24+
],
25+
"groupName": "knope",
26+
"rangeStrategy": "pin"
27+
}
28+
]
729
}

Diff for: .github/workflows/release-dry-run.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
- uses: actions/checkout@v3
1313
with:
1414
fetch-depth: 0
15-
token: ${{ secrets.PAT }}
15+
token: ${{ secrets.GITHUB_TOKEN }}
1616
- name: Install Knope
1717
uses: knope-dev/action@v1
1818
with:
19-
version: 0.6.2
19+
version: 0.7.2
2020
- run: knope release --dry-run

Diff for: .github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Install Knope
2121
uses: knope-dev/action@v1
2222
with:
23-
version: 0.6.2
23+
version: 0.7.2
2424
- name: Bump Version & Create GitHub Release
2525
run: knope release
2626
env:

Diff for: CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ Programmatic usage of this project (e.g., importing it as a Python module) and t
1313

1414
The 0.x prefix used in versions for this project is to indicate that breaking changes are expected frequently (several times a year). Breaking changes will increment the minor number, all other changes will increment the patch number. You can track the progress toward 1.0 [here](https://github.com/openapi-generators/openapi-python-client/projects/2).
1515

16+
## 0.13.2
17+
18+
### Features
19+
20+
- Always generate enums with sorted members (#728)
21+
22+
### Fixes
23+
24+
- Prevent backslashes in descriptions from breaking docstrings [#735]. Thanks @robertschweizer & @bryan-hunt! (#735)
25+
- Respect `required` field in parameters included with `$ref` (#737)
26+
1627
## 0.13.1
1728

1829
### Features

Diff for: end_to_end_tests/custom-templates-golden-record/my_test_api_client/api/tests/__init__.py

+8
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from . import (
66
callback_test,
77
defaults_tests_defaults_post,
8+
description_with_backslash,
89
get_basic_list_of_booleans,
910
get_basic_list_of_floats,
1011
get_basic_list_of_integers,
@@ -158,3 +159,10 @@ def callback_test(cls) -> types.ModuleType:
158159
Try sending a request related to a callback
159160
"""
160161
return callback_test
162+
163+
@classmethod
164+
def description_with_backslash(cls) -> types.ModuleType:
165+
"""
166+
Test description with \
167+
"""
168+
return description_with_backslash

Diff for: end_to_end_tests/golden-record/my_test_api_client/api/default/get_common_parameters.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def _get_kwargs(
2929
"headers": headers,
3030
"cookies": cookies,
3131
"timeout": client.get_timeout(),
32+
"follow_redirects": client.follow_redirects,
3233
"params": params,
3334
}
3435

@@ -37,7 +38,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any
3738
if response.status_code == HTTPStatus.OK:
3839
return None
3940
if client.raise_on_unexpected_status:
40-
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
41+
raise errors.UnexpectedStatus(response.status_code, response.content)
4142
else:
4243
return None
4344

Diff for: end_to_end_tests/golden-record/my_test_api_client/api/default/post_common_parameters.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def _get_kwargs(
2929
"headers": headers,
3030
"cookies": cookies,
3131
"timeout": client.get_timeout(),
32+
"follow_redirects": client.follow_redirects,
3233
"params": params,
3334
}
3435

@@ -37,7 +38,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any
3738
if response.status_code == HTTPStatus.OK:
3839
return None
3940
if client.raise_on_unexpected_status:
40-
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
41+
raise errors.UnexpectedStatus(response.status_code, response.content)
4142
else:
4243
return None
4344

Diff for: end_to_end_tests/golden-record/my_test_api_client/api/location/get_location_header_types.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,15 @@ def _get_kwargs(
4949
"headers": headers,
5050
"cookies": cookies,
5151
"timeout": client.get_timeout(),
52+
"follow_redirects": client.follow_redirects,
5253
}
5354

5455

5556
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]:
5657
if response.status_code == HTTPStatus.OK:
5758
return None
5859
if client.raise_on_unexpected_status:
59-
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
60+
raise errors.UnexpectedStatus(response.status_code, response.content)
6061
else:
6162
return None
6263

Diff for: end_to_end_tests/golden-record/my_test_api_client/api/location/get_location_query_optionality.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def _get_kwargs(
5353
"headers": headers,
5454
"cookies": cookies,
5555
"timeout": client.get_timeout(),
56+
"follow_redirects": client.follow_redirects,
5657
"params": params,
5758
}
5859

@@ -61,7 +62,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any
6162
if response.status_code == HTTPStatus.OK:
6263
return None
6364
if client.raise_on_unexpected_status:
64-
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
65+
raise errors.UnexpectedStatus(response.status_code, response.content)
6566
else:
6667
return None
6768

Diff for: end_to_end_tests/golden-record/my_test_api_client/api/parameter_references/get_parameter_references_path_param.py

+28-25
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,32 @@
11
from http import HTTPStatus
2-
from typing import Any, Dict, Optional
2+
from typing import Any, Dict, Optional, Union
33

44
import httpx
55

66
from ... import errors
77
from ...client import Client
8-
from ...types import UNSET, Response
8+
from ...types import UNSET, Response, Unset
99

1010

1111
def _get_kwargs(
1212
path_param: str,
1313
*,
1414
client: Client,
15-
string_param: str,
16-
integer_param: int = 0,
17-
header_param: str,
18-
cookie_param: str,
15+
string_param: Union[Unset, None, str] = UNSET,
16+
integer_param: Union[Unset, None, int] = 0,
17+
header_param: Union[Unset, str] = UNSET,
18+
cookie_param: Union[Unset, str] = UNSET,
1919
) -> Dict[str, Any]:
2020
url = "{}/parameter-references/{path_param}".format(client.base_url, path_param=path_param)
2121

2222
headers: Dict[str, str] = client.get_headers()
2323
cookies: Dict[str, Any] = client.get_cookies()
2424

25-
headers["header param"] = header_param
25+
if not isinstance(header_param, Unset):
26+
headers["header param"] = header_param
2627

27-
cookies["cookie param"] = cookie_param
28+
if cookie_param is not UNSET:
29+
cookies["cookie param"] = cookie_param
2830

2931
params: Dict[str, Any] = {}
3032
params["string param"] = string_param
@@ -39,6 +41,7 @@ def _get_kwargs(
3941
"headers": headers,
4042
"cookies": cookies,
4143
"timeout": client.get_timeout(),
44+
"follow_redirects": client.follow_redirects,
4245
"params": params,
4346
}
4447

@@ -47,7 +50,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any
4750
if response.status_code == HTTPStatus.OK:
4851
return None
4952
if client.raise_on_unexpected_status:
50-
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
53+
raise errors.UnexpectedStatus(response.status_code, response.content)
5154
else:
5255
return None
5356

@@ -65,19 +68,19 @@ def sync_detailed(
6568
path_param: str,
6669
*,
6770
client: Client,
68-
string_param: str,
69-
integer_param: int = 0,
70-
header_param: str,
71-
cookie_param: str,
71+
string_param: Union[Unset, None, str] = UNSET,
72+
integer_param: Union[Unset, None, int] = 0,
73+
header_param: Union[Unset, str] = UNSET,
74+
cookie_param: Union[Unset, str] = UNSET,
7275
) -> Response[Any]:
7376
"""Test different types of parameter references
7477
7578
Args:
7679
path_param (str):
77-
string_param (str):
78-
integer_param (int):
79-
header_param (str):
80-
cookie_param (str):
80+
string_param (Union[Unset, None, str]):
81+
integer_param (Union[Unset, None, int]):
82+
header_param (Union[Unset, str]):
83+
cookie_param (Union[Unset, str]):
8184
8285
Raises:
8386
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -108,19 +111,19 @@ async def asyncio_detailed(
108111
path_param: str,
109112
*,
110113
client: Client,
111-
string_param: str,
112-
integer_param: int = 0,
113-
header_param: str,
114-
cookie_param: str,
114+
string_param: Union[Unset, None, str] = UNSET,
115+
integer_param: Union[Unset, None, int] = 0,
116+
header_param: Union[Unset, str] = UNSET,
117+
cookie_param: Union[Unset, str] = UNSET,
115118
) -> Response[Any]:
116119
"""Test different types of parameter references
117120
118121
Args:
119122
path_param (str):
120-
string_param (str):
121-
integer_param (int):
122-
header_param (str):
123-
cookie_param (str):
123+
string_param (Union[Unset, None, str]):
124+
integer_param (Union[Unset, None, int]):
125+
header_param (Union[Unset, str]):
126+
cookie_param (Union[Unset, str]):
124127
125128
Raises:
126129
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

Diff for: end_to_end_tests/golden-record/my_test_api_client/api/parameters/delete_common_parameters_overriding_param.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def _get_kwargs(
3030
"headers": headers,
3131
"cookies": cookies,
3232
"timeout": client.get_timeout(),
33+
"follow_redirects": client.follow_redirects,
3334
"params": params,
3435
}
3536

@@ -38,7 +39,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any
3839
if response.status_code == HTTPStatus.OK:
3940
return None
4041
if client.raise_on_unexpected_status:
41-
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
42+
raise errors.UnexpectedStatus(response.status_code, response.content)
4243
else:
4344
return None
4445

Diff for: end_to_end_tests/golden-record/my_test_api_client/api/parameters/get_common_parameters_overriding_param.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def _get_kwargs(
3030
"headers": headers,
3131
"cookies": cookies,
3232
"timeout": client.get_timeout(),
33+
"follow_redirects": client.follow_redirects,
3334
"params": params,
3435
}
3536

@@ -38,7 +39,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any
3839
if response.status_code == HTTPStatus.OK:
3940
return None
4041
if client.raise_on_unexpected_status:
41-
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
42+
raise errors.UnexpectedStatus(response.status_code, response.content)
4243
else:
4344
return None
4445

Diff for: end_to_end_tests/golden-record/my_test_api_client/api/parameters/get_same_name_multiple_locations_param.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def _get_kwargs(
3838
"headers": headers,
3939
"cookies": cookies,
4040
"timeout": client.get_timeout(),
41+
"follow_redirects": client.follow_redirects,
4142
"params": params,
4243
}
4344

@@ -46,7 +47,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any
4647
if response.status_code == HTTPStatus.OK:
4748
return None
4849
if client.raise_on_unexpected_status:
49-
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
50+
raise errors.UnexpectedStatus(response.status_code, response.content)
5051
else:
5152
return None
5253

Diff for: end_to_end_tests/golden-record/my_test_api_client/api/parameters/multiple_path_parameters.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,15 @@ def _get_kwargs(
2929
"headers": headers,
3030
"cookies": cookies,
3131
"timeout": client.get_timeout(),
32+
"follow_redirects": client.follow_redirects,
3233
}
3334

3435

3536
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]:
3637
if response.status_code == HTTPStatus.OK:
3738
return None
3839
if client.raise_on_unexpected_status:
39-
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
40+
raise errors.UnexpectedStatus(response.status_code, response.content)
4041
else:
4142
return None
4243

Diff for: end_to_end_tests/golden-record/my_test_api_client/api/responses/post_responses_unions_simple_before_complex.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def _get_kwargs(
2626
"headers": headers,
2727
"cookies": cookies,
2828
"timeout": client.get_timeout(),
29+
"follow_redirects": client.follow_redirects,
2930
}
3031

3132

@@ -37,7 +38,7 @@ def _parse_response(
3738

3839
return response_200
3940
if client.raise_on_unexpected_status:
40-
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
41+
raise errors.UnexpectedStatus(response.status_code, response.content)
4142
else:
4243
return None
4344

Diff for: end_to_end_tests/golden-record/my_test_api_client/api/tag1/get_tag_with_number.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@ def _get_kwargs(
2323
"headers": headers,
2424
"cookies": cookies,
2525
"timeout": client.get_timeout(),
26+
"follow_redirects": client.follow_redirects,
2627
}
2728

2829

2930
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]:
3031
if response.status_code == HTTPStatus.OK:
3132
return None
3233
if client.raise_on_unexpected_status:
33-
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
34+
raise errors.UnexpectedStatus(response.status_code, response.content)
3435
else:
3536
return None
3637

Diff for: end_to_end_tests/golden-record/my_test_api_client/api/tests/callback_test.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def _get_kwargs(
2828
"headers": headers,
2929
"cookies": cookies,
3030
"timeout": client.get_timeout(),
31+
"follow_redirects": client.follow_redirects,
3132
"json": json_json_body,
3233
}
3334

@@ -41,7 +42,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
4142

4243
return response_422
4344
if client.raise_on_unexpected_status:
44-
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
45+
raise errors.UnexpectedStatus(response.status_code, response.content)
4546
else:
4647
return None
4748

0 commit comments

Comments
 (0)