Skip to content

Commit

Permalink
Release 0.21.5 (#1115)
Browse files Browse the repository at this point in the history
> [!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>
  • Loading branch information
knope-bot[bot] authored Sep 7, 2024
1 parent b1c2abd commit 90e0954
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 33 deletions.
5 changes: 0 additions & 5 deletions .changeset/allow_default_values_for_properties_of_any_type.md

This file was deleted.

20 changes: 0 additions & 20 deletions .changeset/improved_property_merging.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/no_properties_fix.md

This file was deleted.

29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,35 @@ Programmatic usage of this project (e.g., importing it as a Python module) and t

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).

## 0.21.5 (2024-09-07)

### 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!

## 0.21.4 (2024-08-25)

### Fixes
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies = [
"typing-extensions>=4.8.0,<5.0.0",
]
name = "openapi-python-client"
version = "0.21.4"
version = "0.21.5"
description = "Generate modern Python clients from OpenAPI"
keywords = [
"OpenAPI",
Expand Down

0 comments on commit 90e0954

Please sign in to comment.