Skip to content

Commit 4c019d9

Browse files
Release 0.21.6 (#1139)
> [!IMPORTANT] > Merging this pull request will create this release ## Features - update Ruff to >=0.2,<0.8 (#1137) - Add UUID string format. Thanks @estyrke! (#1140) - Support OpenAPI 3.1 prefixItems property for arrays. Thanks @estyrke! (#1141) ### Add `literal_enums` config setting Instead of the default `Enum` classes for enums, you can now generate `Literal` sets wherever `enum` appears in the OpenAPI spec by setting `literal_enums: true` in your config file. ```yaml literal_enums: true ``` Thanks to @emosenkis for PR #1114 closes #587, #725, #1076, and probably many more. Thanks also to @eli-bl, @expobrain, @theorm, @chrisguillory, and anyone else who helped getting to this design! ## Fixes - Typo in docstring (#1128) ### Use literal value instead of `HTTPStatus` enum when checking response statuses Python 3.13 renamed some of the `HTTPStatus` enum members, which means clients generated with Python 3.13 may not work with older versions of Python. This change stops using the `HTTPStatus` enum directly when checking response statuses. Statuses will still be checked for validity at generation time, and transformed into `HTTPStatus` _after_ being checked at runtime. This may cause some linters to complain. Co-authored-by: knope-bot[bot] <152252888+knope-bot[bot]@users.noreply.github.com>
1 parent cd3e70b commit 4c019d9

4 files changed

+34
-28
lines changed

.changeset/add_literal_enums_config_setting.md

-14
This file was deleted.

.changeset/use_literal_value_instead_of_httpstatus_enum_when_checking_response_statuses.md

-13
This file was deleted.

CHANGELOG.md

+33
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,39 @@ 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.21.6 (2024-10-20)
17+
18+
### Features
19+
20+
- update Ruff to >=0.2,<0.8 (#1137)
21+
- Add UUID string format. Thanks @estyrke! (#1140)
22+
- Support OpenAPI 3.1 prefixItems property for arrays. Thanks @estyrke! (#1141)
23+
24+
#### Add `literal_enums` config setting
25+
26+
Instead of the default `Enum` classes for enums, you can now generate `Literal` sets wherever `enum` appears in the OpenAPI spec by setting `literal_enums: true` in your config file.
27+
28+
```yaml
29+
literal_enums: true
30+
```
31+
32+
Thanks to @emosenkis for PR #1114 closes #587, #725, #1076, and probably many more.
33+
Thanks also to @eli-bl, @expobrain, @theorm, @chrisguillory, and anyone else who helped getting to this design!
34+
35+
### Fixes
36+
37+
- Typo in docstring (#1128)
38+
39+
#### Use literal value instead of `HTTPStatus` enum when checking response statuses
40+
41+
Python 3.13 renamed some of the `HTTPStatus` enum members, which means clients generated with Python 3.13 may not work
42+
with older versions of Python. This change stops using the `HTTPStatus` enum directly when checking response statuses.
43+
44+
Statuses will still be checked for validity at generation time, and transformed into `HTTPStatus` _after_ being checked
45+
at runtime.
46+
47+
This may cause some linters to complain.
48+
1649
## 0.21.5 (2024-09-07)
1750

1851
### Features

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies = [
1818
"typing-extensions>=4.8.0,<5.0.0",
1919
]
2020
name = "openapi-python-client"
21-
version = "0.21.5"
21+
version = "0.21.6"
2222
description = "Generate modern Python clients from OpenAPI"
2323
keywords = [
2424
"OpenAPI",

0 commit comments

Comments
 (0)