Openapi-python-client

Latest version: v0.21.6

Safety actively analyzes 675388 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 13

1.2

This change switches the YAML parsing library to `ruamel.yaml` which follows the YAML 1.2 specification.
[There are breaking changes](https://yaml.readthedocs.io/en/latest/pyyaml/#defaulting-to-yaml-12-support) from YAML 1.1 to 1.2,
though they will not affect most use cases.

PR 1042 fixes 1041. Thanks rtaycher!

Features

- allow Ruff 0.4 (1031)

Fixes

Fix nullable and required properties in multipart bodies

Fixes 926.

> [!WARNING]
> This change is likely to break custom templates. Multipart body handling has been completely split from JSON bodies.

0.21.6

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.

0.21.5

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

Fixes

Allow OpenAPI 3.1-style `exclusiveMinimum` and `exclusiveMaximum`

Fixed by PR 1092. Thanks mikkelam!

Add missing `cast` import when using `const`

Fixed by PR 1072. Thanks dorcohe!

Correctly resolve references to a type that is itself just a single allOf reference

PR 1103 fixed issue 1091. Thanks eli-bl!

Support `const` booleans and floats

Fixed in PR 1086. Thanks flxdot!

0.21.3

Features

- update Ruff to >=0.2,<0.7 (1097)

0.21.2

Features

- Update to Ruff 0.5

Page 1 of 13

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.