Skip to content

Commit 90e0954

Browse files
Release 0.21.5 (#1115)
> [!IMPORTANT] > Merging this pull request will create this release ## Features ### Improved property-merging behavior with `allOf` When using `allOf` to extend a base object type, `openapi-python-client` is now able to handle some kinds of modifications to an existing property that would have previously caused an error: - Overriding attributes that do not affect validation, such as `description`. - Combining properties that this generator ignores, like `maxLength` or `pattern`. - Combining a generic numeric type with `int` (resulting in `int`). - Adding a `format` to a string. - Combining `any` with a specific type (resulting in that specific type). - Adding or overriding a `default` > [!NOTE] > `pattern` and `max_length` are no longer fields on `StringProperty`, which may impact custom templates. This also fixes a bug where properties of inline objects (as opposed to references) were not using the merge logic, but were simply overwriting previous definitions of the same property. ## Fixes - Allow default values for properties of `Any` type ### Produce valid code for an object that has no properties at all Fixed by PR #1109. Thanks @eli-bl! Co-authored-by: knope-bot[bot] <152252888+knope-bot[bot]@users.noreply.github.com>
1 parent b1c2abd commit 90e0954

5 files changed

+30
-33
lines changed

.changeset/allow_default_values_for_properties_of_any_type.md

-5
This file was deleted.

.changeset/improved_property_merging.md

-20
This file was deleted.

.changeset/no_properties_fix.md

-7
This file was deleted.

CHANGELOG.md

+29
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,35 @@ 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.5 (2024-09-07)
17+
18+
### Features
19+
20+
#### Improved property-merging behavior with `allOf`
21+
22+
When using `allOf` to extend a base object type, `openapi-python-client` is now able to handle some kinds of modifications to an existing property that would have previously caused an error:
23+
24+
- Overriding attributes that do not affect validation, such as `description`.
25+
- Combining properties that this generator ignores, like `maxLength` or `pattern`.
26+
- Combining a generic numeric type with `int` (resulting in `int`).
27+
- Adding a `format` to a string.
28+
- Combining `any` with a specific type (resulting in that specific type).
29+
- Adding or overriding a `default`
30+
31+
> [!NOTE]
32+
> `pattern` and `max_length` are no longer fields on `StringProperty`, which may impact custom templates.
33+
34+
This also fixes a bug where properties of inline objects (as opposed to references) were not using the
35+
merge logic, but were simply overwriting previous definitions of the same property.
36+
37+
### Fixes
38+
39+
- Allow default values for properties of `Any` type
40+
41+
#### Produce valid code for an object that has no properties at all
42+
43+
Fixed by PR #1109. Thanks @eli-bl!
44+
1645
## 0.21.4 (2024-08-25)
1746

1847
### Fixes

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.4"
21+
version = "0.21.5"
2222
description = "Generate modern Python clients from OpenAPI"
2323
keywords = [
2424
"OpenAPI",

0 commit comments

Comments
 (0)