🌐 AI搜索 & 代理 主页
Skip to content

Tags: openapi-generators/openapi-python-client

Tags

v0.28.0

Toggle v0.28.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Release 0.28.0 (#1368)

> [!IMPORTANT]
> Merging this pull request will create this release

## Breaking Changes

- URL-encode path parameters in generated endpoints (#1349)

## Fixes

### Fix bad code generation

#1360 by @EricAtORS

This fixes:
- missing parenthesis in to_multipart
 #1338 #1318
- missing imports in the lazy eval in to_multipart:
#931 and #1051

### Fix optional bodies

If a body is not required (the default), it will now:

1. Have `Unset` as part of its type annotation.
2. Default to a value of `UNSET`
3. Not be included in the request if it is `UNSET`

Thanks @orelmaliach for the report! Fixes #1354

Co-authored-by: knope-bot[bot] <152252888+knope-bot[bot]@users.noreply.github.com>

v0.27.1

Toggle v0.27.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Release 0.27.1 (#1345)

> [!IMPORTANT]
> Merging this pull request will create this release

## Fixes

- Remove non-existent CHANGELOG.md references from UV and Poetry
templates (#1344)
- Initialize optional lists as UNSET, not [] (#1346)
- Correct docstring typos in client template (#1347)
- Replace bare except blocks with specific exception types (#1348)

### Update `uv_build` to 0.9

#1352 by @johnthagen

`uv` has been in the `0.9.x` release cycle for a while, so update
templates to use the corresponding `uv_build` range.

Co-authored-by: knope-bot[bot] <152252888+knope-bot[bot]@users.noreply.github.com>

v0.27.0

Toggle v0.27.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Release 0.27.0 (#1330)

> [!IMPORTANT]
> Merging this pull request will create this release

## Breaking Changes

### Drop support for Python 3.9

Both `openapi-python-client` itself and any generated clients no longer
support Python 3.9.

### Generated models now use `from __future__ import annotations`

This simplifies using forward references with the newer union syntax.

## Features

### Upgrade generated clients to 3.10 union syntax

All generated types now use the `A | B` syntax instead of `Union[A, B]`
or `Optional[A]`.

## Fixes

- Drop generated `requires-python` upper bounds for uv and PDM (#1329)

### Change default Ruff hook to `--fix-only`

This should enable `openapi-python-client` to keep auto-fixing lints
(like removing unused imports) but _not_ fail to
generate when unfixable lints are violated.

Since it's now unlikely for breaking changes to affect our usage (and by
popular request), the upper bound of `ruff`
has been lifted. Newer versions of `openapi-python-client` should no
longer be required to support newer versions of `ruff`.

## Notes

- Minimum Typer version is now 0.16

Co-authored-by: knope-bot[bot] <152252888+knope-bot[bot]@users.noreply.github.com>

v0.26.2

Toggle v0.26.2's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Release 0.26.2 (#1322)

> [!IMPORTANT]
> Merging this pull request will create this release

## Fixes

- ambigious tilde specifier requires-python with`--meta=uv` (#1321)

Co-authored-by: knope-bot[bot] <152252888+knope-bot[bot]@users.noreply.github.com>

v0.26.1

Toggle v0.26.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Release 0.26.1 (#1320)

> [!IMPORTANT]
> Merging this pull request will create this release

## Features

- Reference schema support (#800) (#1307)
- Support Ruff 0.13

Co-authored-by: knope-bot[bot] <152252888+knope-bot[bot]@users.noreply.github.com>

v0.26.0

Toggle v0.26.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Release 0.26.0 (#1306)

> [!IMPORTANT]
> Merging this pull request will create this release

## Breaking Changes

### Change some union variant names

When creating a union with `oneOf`, `anyOf`, or a list of `type`, the
name of each variant used to be `type_{index}`
where the index is based on the order of the types in the union.

This made some modules difficult to understand, what is a
`my_type_type_0` after all?
It also meant that reordering union members, while not a breaking change
to the API, _would_ be a breaking change
for generated clients.

Now, if an individual variant has a `title` attribute, that `title` will
be used in the name instead.
This is only an enhancement for documents which use `title` in union
variants, and only a breaking change for
_inline models_ (not `#/components/schemas` which should already have
used more descriptive names).

Thanks @wallagib for PR #962!

## Features

### Support patterned and default HTTP statuses

HTTP statuses like `2XX` and `default` are now supported!

A big thank you to:
- @PSU3D0 for PR #973 (eons ago 😅)
- @obs-gh-peterkolloch for PR #1300
- @goodsonjr for PR #1304

Closes #1271 and #832

> [!NOTE]
> Custom template users: the `endpoint.responses` type has changed quite
a bit. Check out #1303 for the changes.

Co-authored-by: knope-bot[bot] <152252888+knope-bot[bot]@users.noreply.github.com>

v0.25.3

Toggle v0.25.3's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Release 0.25.3 (#1288)

> [!IMPORTANT]
> Merging this pull request will create this release

## Features

- Add --meta uv for generating astral-sh/uv compatible packages. (#1286)
- Switch to `uv_build` build backend. (#1290)

Co-authored-by: knope-bot[bot] <152252888+knope-bot[bot]@users.noreply.github.com>

v0.25.2

Toggle v0.25.2's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Release 0.25.2 (#1279)

> [!IMPORTANT]
> Merging this pull request will create this release

## Fixes

- Import error for `types.FileType` (#1274) (#1278)

Co-authored-by: knope-bot[bot] <152252888+knope-bot[bot]@users.noreply.github.com>

v0.25.1

Toggle v0.25.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Release 0.25.1 (#1273)

> [!IMPORTANT]
> Merging this pull request will create this release

## Fixes

- Support ruff 0.12 (#1270)

Co-authored-by: knope-bot[bot] <152252888+knope-bot[bot]@users.noreply.github.com>

v0.25.0

Toggle v0.25.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Release 0.25.0 (#1267)

> [!IMPORTANT]
> Merging this pull request will create this release

## Breaking Changes

- Raise minimum httpx version to 0.23

### Removed ability to set an array as a multipart body

Previously, when defining a request's body as `multipart/form-data`, the
generator would attempt to generate code
for both `object` schemas and `array` schemas. However, most arrays
could not generate valid multipart bodies, as
there would be no field names (required to set the `Content-Disposition`
headers).

The code to generate any body for `multipart/form-data` where the schema
is `array` has been removed, and any such
bodies will be skipped. This is not _expected_ to be a breaking change
in practice, since the code generated would
probably never work.

If you have a use-case for `multipart/form-data` with an `array` schema,
please [open a new
discussion](https://github.com/openapi-generators/openapi-python-client/discussions)
with an example schema and the desired functional Python code.

### Change default multipart array serialization

Previously, any arrays of values in a `multipart/form-data` body would
be serialized as an `application/json` part.
This matches the default behavior specified by OpenAPI and supports
arrays of files (`binary` format strings).
However, because this generator doesn't yet support specifying
`encoding` per property, this may result in
now-incorrect code when the encoding _was_ explicitly set to
`application/json` for arrays of scalar values.

PR #938 fixes #692. Thanks @micha91 for the fix, @ratgen and
@FabianSchurig for testing, and @davidlizeng for the original report...
many years ago 😅.

Co-authored-by: knope-bot[bot] <152252888+knope-bot[bot]@users.noreply.github.com>