Skip to content

Commit d780e58

Browse files
committed
merge enumerate-duplicate-model-names and main
2 parents 8ebcf1e + 8ce5705 commit d780e58

163 files changed

Lines changed: 3327 additions & 1973 deletions

File tree

Some content is hidden

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

.github/workflows/checks.yml

Lines changed: 16 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ jobs:
1515
os: [ ubuntu-latest, macos-latest, windows-latest ]
1616
runs-on: ${{ matrix.os }}
1717
steps:
18-
- uses: actions/checkout@v4.2.2
18+
- uses: actions/checkout@v5.0.0
1919
- name: Set up Python
20-
uses: actions/setup-python@v5.5.0
20+
uses: actions/setup-python@v6.0.0
2121
with:
2222
python-version: ${{ matrix.python }}
2323

@@ -74,9 +74,9 @@ jobs:
7474
os: [ ubuntu-latest, macos-latest, windows-latest ]
7575
runs-on: ${{ matrix.os }}
7676
steps:
77-
- uses: actions/checkout@v4.2.2
77+
- uses: actions/checkout@v5.0.0
7878
- name: Set up Python
79-
uses: actions/setup-python@v5.5.0
79+
uses: actions/setup-python@v6.0.0
8080
with:
8181
python-version: "3.9"
8282

@@ -101,9 +101,6 @@ jobs:
101101
- name: Run mypy
102102
run: pdm mypy --show-error-codes
103103

104-
- name: Lint
105-
run: pdm run ruff check .
106-
107104
- name: Run unit tests only # snapshots are expected to fail
108105
run: pdm unit_test
109106

@@ -112,12 +109,12 @@ jobs:
112109
needs: test
113110
runs-on: ubuntu-latest
114111
steps:
115-
- uses: actions/checkout@v4.2.2
116-
- uses: actions/setup-python@v5
112+
- uses: actions/checkout@v5.0.0
113+
- uses: actions/setup-python@v6
117114
with:
118115
python-version: "3.12"
119116
- name: Download coverage reports
120-
uses: actions/download-artifact@v4.2.1
117+
uses: actions/download-artifact@v5.0.0
121118
with:
122119
merge-multiple: true
123120

@@ -153,51 +150,35 @@ jobs:
153150
runs-on: ubuntu-latest
154151
strategy:
155152
matrix:
156-
httpx_version:
157-
- "0.20.0"
158-
- ""
153+
lockfile:
154+
- "pdm.lock"
155+
- "pdm.minimal.lock"
159156
services:
160157
openapi-test-server:
161-
image: ghcr.io/openapi-generators/openapi-test-server:0.0.1
158+
image: ghcr.io/openapi-generators/openapi-test-server:0.2.1
162159
ports:
163160
- "3000:3000"
164161
steps:
165-
- uses: actions/checkout@v4.2.2
162+
- uses: actions/checkout@v5.0.0
166163
- name: Set up Python
167-
uses: actions/setup-python@v5.5.0
164+
uses: actions/setup-python@v6.0.0
168165
with:
169166
python-version: "3.9"
170167
- name: Get Python Version
171168
id: get_python_version
172169
run: echo "python_version=$(python --version)" >> $GITHUB_OUTPUT
173-
- name: Cache dependencies
174-
uses: actions/cache@v4
175-
with:
176-
path: .venv
177-
key: ${{ runner.os }}-${{ steps.get_python_version.outputs.python_version }}-dependencies-${{ hashFiles('**/pdm.lock') }}
178-
restore-keys: |
179-
${{ runner.os }}-${{ steps.get_python_version.outputs.python_version }}-dependencies
180-
- name: Install dependencies
181-
run: |
182-
pip install pdm
183-
python -m venv .venv
184-
pdm install
185170
- name: Cache Generated Client Dependencies
186171
uses: actions/cache@v4
187172
with:
188173
path: integration-tests/.venv
189-
key: ${{ runner.os }}-${{ steps.get_python_version.outputs.python_version }}-integration-dependencies-${{ hashFiles('**/pdm.lock') }}
174+
key: ${{ runner.os }}-${{ steps.get_python_version.outputs.python_version }}-integration-dependencies-${{ hashFiles('integration-tests/pdm*.lock') }}
190175
restore-keys: |
191176
${{ runner.os }}-${{ steps.get_python_version.outputs.python_version }}-integration-dependencies
192-
- name: Set httpx version
193-
if: matrix.httpx_version != ''
194-
run: |
195-
cd integration-tests
196-
pdm add httpx==${{ matrix.httpx_version }}
197177
- name: Install Integration Dependencies
198178
run: |
199179
cd integration-tests
200-
pdm install
180+
pip install pdm
181+
pdm install -L ${{ matrix.lockfile }}
201182
- name: Run Tests
202183
run: |
203184
cd integration-tests

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ jobs:
1212
permissions:
1313
id-token: write
1414
steps:
15-
- uses: actions/checkout@v4.2.2
15+
- uses: actions/checkout@v5.0.0
1616
- name: Install Hatchling
1717
run: pip install --upgrade hatchling
1818
- name: Build
1919
run: hatchling build
2020
- name: Push to PyPI
21-
uses: pypa/gh-action-pypi-publish@v1.12.4
21+
uses: pypa/gh-action-pypi-publish@v1.13.0
2222
with:
2323
attestations: true

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,5 @@ htmlcov/
3636
# Generated end to end test data
3737
my-test-api-client/
3838
custom-e2e/
39-
3-1-features-client
39+
3-1-features-client
40+
tests/tmp

CHANGELOG.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,94 @@ 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.26.1 (2025-09-13)
17+
18+
### Features
19+
20+
- Reference schema support (#800) (#1307)
21+
- Support Ruff 0.13
22+
23+
## 0.26.0 (2025-08-26)
24+
25+
### Breaking Changes
26+
27+
#### Change some union variant names
28+
29+
When creating a union with `oneOf`, `anyOf`, or a list of `type`, the name of each variant used to be `type_{index}`
30+
where the index is based on the order of the types in the union.
31+
32+
This made some modules difficult to understand, what is a `my_type_type_0` after all?
33+
It also meant that reordering union members, while not a breaking change to the API, _would_ be a breaking change
34+
for generated clients.
35+
36+
Now, if an individual variant has a `title` attribute, that `title` will be used in the name instead.
37+
This is only an enhancement for documents which use `title` in union variants, and only a breaking change for
38+
_inline models_ (not `#/components/schemas` which should already have used more descriptive names).
39+
40+
Thanks @wallagib for PR #962!
41+
42+
### Features
43+
44+
#### Support patterned and default HTTP statuses
45+
46+
HTTP statuses like `2XX` and `default` are now supported!
47+
48+
A big thank you to:
49+
- @PSU3D0 for PR #973 (eons ago 😅)
50+
- @obs-gh-peterkolloch for PR #1300
51+
- @goodsonjr for PR #1304
52+
53+
Closes #1271 and #832
54+
55+
> [!NOTE]
56+
> Custom template users: the `endpoint.responses` type has changed quite a bit. Check out #1303 for the changes.
57+
58+
## 0.25.3 (2025-07-21)
59+
60+
### Features
61+
62+
- Add --meta uv for generating astral-sh/uv compatible packages. (#1286)
63+
- Switch to `uv_build` build backend. (#1290)
64+
65+
## 0.25.2 (2025-07-03)
66+
67+
### Fixes
68+
69+
- Import error for `types.FileType` (#1274) (#1278)
70+
71+
## 0.25.1 (2025-06-19)
72+
73+
### Fixes
74+
75+
- Support ruff 0.12 (#1270)
76+
77+
## 0.25.0 (2025-06-06)
78+
79+
### Breaking Changes
80+
81+
- Raise minimum httpx version to 0.23
82+
83+
#### Removed ability to set an array as a multipart body
84+
85+
Previously, when defining a request's body as `multipart/form-data`, the generator would attempt to generate code
86+
for both `object` schemas and `array` schemas. However, most arrays could not generate valid multipart bodies, as
87+
there would be no field names (required to set the `Content-Disposition` headers).
88+
89+
The code to generate any body for `multipart/form-data` where the schema is `array` has been removed, and any such
90+
bodies will be skipped. This is not _expected_ to be a breaking change in practice, since the code generated would
91+
probably never work.
92+
93+
If you have a use-case for `multipart/form-data` with an `array` schema, please [open a new discussion](https://github.com/openapi-generators/openapi-python-client/discussions) with an example schema and the desired functional Python code.
94+
95+
#### Change default multipart array serialization
96+
97+
Previously, any arrays of values in a `multipart/form-data` body would be serialized as an `application/json` part.
98+
This matches the default behavior specified by OpenAPI and supports arrays of files (`binary` format strings).
99+
However, because this generator doesn't yet support specifying `encoding` per property, this may result in
100+
now-incorrect code when the encoding _was_ explicitly set to `application/json` for arrays of scalar values.
101+
102+
PR #938 fixes #692. Thanks @micha91 for the fix, @ratgen and @FabianSchurig for testing, and @davidlizeng for the original report... many years ago 😅.
103+
16104
## 0.24.3 (2025-03-31)
17105

18106
### Features

end_to_end_tests/__snapshots__/test_end_to_end.ambr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
WARNING parsing GET / within default.
88

9-
Invalid response status code abcdef (not a valid HTTP status code), response will be omitted from generated client
9+
Invalid response status code pattern: abcdef, response will be omitted from generated client
1010

1111

1212
If you believe this was a mistake or this tool is missing a feature you need, please open an issue at https://github.com/openapi-generators/openapi-python-client/issues/new/choose

0 commit comments

Comments
 (0)