Skip to content

Release 0.21.5 #1115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 7, 2024
Merged

Release 0.21.5 #1115

merged 1 commit into from
Sep 7, 2024

Conversation

knope-bot[bot]
Copy link
Contributor

@knope-bot knope-bot bot commented Sep 2, 2024

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!

@knope-bot knope-bot bot force-pushed the knope/release branch 7 times, most recently from 23e404a to b1c2abd Compare September 7, 2024 21:53
@dbanty dbanty added this pull request to the merge queue Sep 7, 2024
Merged via the queue into main with commit 90e0954 Sep 7, 2024
18 checks passed
@dbanty dbanty deleted the knope/release branch September 7, 2024 22:09
micha91 pushed a commit to micha91/openapi-python-client that referenced this pull request May 13, 2025
> [!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 openapi-generators#1109. Thanks @eli-bl!

Co-authored-by: knope-bot[bot] <152252888+knope-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant