Skip to content

Commit a7e8fb1

Browse files
authored
Merge branch 'main' into multiple_tags
2 parents 0d1df64 + 4823d96 commit a7e8fb1

File tree

129 files changed

+5158
-1606
lines changed

Some content is hidden

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

129 files changed

+5158
-1606
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: GitHub Discussions
4+
url: https://github.com/openapi-generators/openapi-python-client/discussions
5+
about: Please ask and answer questions here.
6+
- name: Discord
7+
url: https://discord.gg/JaqVvBgwYw
8+
about: Less structured, more casual chat.

.github/renovate.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,28 @@
22
"extends": [
33
"config:base",
44
":semanticCommitTypeAll(chore)"
5+
],
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+
}
528
]
629
}

.github/workflows/checks.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ on:
55
branches: [ "main" ]
66
pull_request:
77
branches: [ "main" ]
8+
merge_group:
89

910
jobs:
1011
test:
1112
strategy:
1213
matrix:
13-
python: [ "3.7", "3.8", "3.9", "3.10" ]
14+
python: [ "3.8", "3.9", "3.10", "3.11" ]
1415
os: [ ubuntu-latest, macos-latest, windows-latest ]
1516
runs-on: ${{ matrix.os }}
1617
steps:
@@ -22,7 +23,7 @@ jobs:
2223

2324
- name: Get Python Version
2425
id: get_python_version
25-
run: echo "::set-output name=python_version::$(python --version)"
26+
run: echo "python_version=$(python --version)" >> $GITHUB_OUTPUT
2627

2728
- name: Cache dependencies
2829
uses: actions/cache@v3
@@ -87,7 +88,7 @@ jobs:
8788
python-version: "3.10"
8889
- name: Get Python Version
8990
id: get_python_version
90-
run: echo "::set-output name=python_version::$(python --version)"
91+
run: echo "python_version=$(python --version)" >> $GITHUB_OUTPUT
9192
- name: Cache dependencies
9293
uses: actions/cache@v3
9394
with:

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
branches: [main]
99
schedule:
1010
- cron: '0 23 * * 2'
11+
merge_group:
1112

1213
jobs:
1314
analyze:

.github/workflows/release-dry-run.yml

Lines changed: 2 additions & 2 deletions
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.3
2020
- run: knope release --dry-run

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
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.3
2424
- name: Bump Version & Create GitHub Release
2525
run: knope release
2626
env:

CHANGELOG.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,108 @@ 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.14.1
17+
18+
### Fixes
19+
20+
- Allow parameters named "client" and "url" [#758, #762, #765]. Thanks @truenicoco & @juanber84!
21+
22+
## 0.14.0
23+
24+
### Breaking Changes
25+
26+
- Drop support for Python 3.7, put minimum version limit on Black (#754)
27+
28+
### Features
29+
30+
- Better typing (mypy) support for `Unset` (e.g., using if statements to check type) [#714, #752]. Thanks @taasan & @mcclurem! (#752)
31+
32+
### Fixes
33+
34+
- pyproject_no_poetry.toml.jinja template can be used to configure black and isort (closes #750) (#751)
35+
36+
## 0.13.4
37+
38+
### Features
39+
40+
- support httpx 0.24 (#746)
41+
42+
## 0.13.3
43+
44+
### Features
45+
46+
- Extend the UnexpectedStatus exception to include the response's content (#729)
47+
- Added support of follow HTTP redirects (#724). Thanks @expobrain & @emann!
48+
49+
### Fixes
50+
51+
- Parsing endpoint content types with semicolon separator (#727). Thanks @expobrain!
52+
- Remove Response[] from docstring of non-detailed functions (#741). Thanks @robertschweizer!
53+
54+
## 0.13.2
55+
56+
### Features
57+
58+
- Always generate enums with sorted members (#728)
59+
60+
### Fixes
61+
62+
- Prevent backslashes in descriptions from breaking docstrings [#735]. Thanks @robertschweizer & @bryan-hunt! (#735)
63+
- Respect `required` field in parameters included with `$ref` (#737)
64+
65+
## 0.13.1
66+
67+
### Features
68+
69+
- Add `http_timeout` config to set timeout getting document via `--url` [#718]. Thanks @Kircheneer!
70+
71+
## 0.13.0
72+
73+
### Breaking Changes
74+
75+
- run `post_hooks` in package directory instead of current directory if meta=none [#696, #697]. Thanks @brenmous and @wallagib!
76+
- Treat leading underscore as a sign of invalid identifier [#703]. Thanks @maxkomarychev!
77+
78+
### Fixes
79+
80+
- generated docstring for `Client.get_headers` function [#713]. Thanks @rtaycher!
81+
82+
## 0.12.3
83+
84+
### Features
85+
86+
- Add `raise_on_unexpected_status` flag to generated `Client` [#593]. Thanks @JamesHinshelwood, @ramnes, @gwenshap, @theFong!
87+
- add `use_path_prefixes_for_title_model_names` config option for simpler model names [#559, #560]. Thanks @rtaycher!
88+
- Support any content type ending in `+json` [#706, #709]. Thanks @XioNoX and @mtovt!
89+
90+
## 0.12.2
91+
92+
### Fixes
93+
94+
- Support Python 3.11.0 (#701)
95+
96+
## 0.12.1
97+
98+
### Fixes
99+
100+
- Version bump due to PyPI error
101+
102+
## 0.12.0
103+
104+
### Breaking Changes
105+
106+
- Change the `Response.status_code` type to the `HTTPStatus` enum [#665]
107+
108+
### Features
109+
110+
- Add `endpoint_collections_by_tag` and `openapi` to the templating globals [#689]. Thanks @paulo-raca!
111+
- Support for recursive and circular references using lazy imports [#670, #338, #466]. Thanks @maz808 & @mtovt!
112+
- Include `__all__` in generated `__init__.py` files [#676, #631, #540, #675]. Thanks @EltonChou!
113+
114+
### Fixes
115+
116+
- If data.type is None but has data.properties, assume type is object [#691, #674]. Thanks @ahuang11!
117+
16118
## 0.11.6
17119

18120
### Features

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,7 @@ package_name_override: my_extra_special_package_name
127127

128128
### field_prefix
129129

130-
When generating properties, the `name` attribute of the OpenAPI schema will be used. When the `name` is not a valid
131-
Python identifier (e.g. begins with a number) this string will be prepended. Defaults to "field\_".
130+
When generating properties, the `name` attribute of the OpenAPI schema will be used. When the `name` is not a valid Python identifier (e.g. begins with a number) this string will be prepended. Defaults to "field\_". It will also be used to prefix fields in schema starting with "_" in order to avoid ambiguous semantics.
132131

133132
Example:
134133

@@ -157,5 +156,17 @@ post_hooks:
157156
- "black ."
158157
```
159158

159+
### use_path_prefixes_for_title_model_names
160+
161+
By default, `openapi-python-client` generates class names which include the full path to the schema, including any parent-types. This can result in very long class names like `MyRouteSomeClassAnotherClassResponse`—which is very unique and unlikely to cause conflicts with future API additions, but also super verbose.
162+
163+
If you are carefully curating your `title` properties already to ensure no duplicate class names, you can turn off this prefixing feature by setting `use_path_prefixes_for_title_model_names` to `false` in your config file. This will use the `title` property of any object that has it set _without_ prefixing.
164+
165+
If this option results in conflicts, you will need to manually override class names instead via the `class_overrides` option.
166+
167+
### http_timeout
168+
169+
By default, the timeout for retrieving the schema file via HTTP is 5 seconds. In case there is an error when retrieving the schema, you might try and increase this setting to a higher value.
170+
160171
[changelog.md]: CHANGELOG.md
161172
[poetry]: https://python-poetry.org/

end_to_end_tests/custom-templates-golden-record/my_test_api_client/api/default/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import types
44

5-
from . import get_common_parameters, post_common_parameters
5+
from . import get_common_parameters, post_common_parameters, reserved_parameters
66

77

88
class DefaultEndpoints:
@@ -13,3 +13,7 @@ def get_common_parameters(cls) -> types.ModuleType:
1313
@classmethod
1414
def post_common_parameters(cls) -> types.ModuleType:
1515
return post_common_parameters
16+
17+
@classmethod
18+
def reserved_parameters(cls) -> types.ModuleType:
19+
return reserved_parameters

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

Lines changed: 8 additions & 0 deletions
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

0 commit comments

Comments
 (0)