Skip to content
This repository was archived by the owner on Aug 5, 2024. It is now read-only.

Update dependency openapi-python-client to v0.21.2 #8

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Aug 28, 2022

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
openapi-python-client ==0.11.5 -> ==0.21.2 age adoption passing confidence

Release Notes

openapi-generators/openapi-python-client (openapi-python-client)

v0.21.2

Compare Source

Features
  • Update to Ruff 0.5

v0.21.1

Compare Source

Features
Support request body refs

You can now define and reuse bodies via refs, with a document like this:

paths:
  /something:
    post:
      requestBody:
        "$ref": "#/components/requestBodies/SharedBody"
components:
  requestBodies:
    SharedBody:
      content:
        application/json:
          schema:
            type: string

Thanks to @​kigawas and @​supermihi for initial implementations and @​RockyMM for the initial request.

Closes #​633, closes #​664, resolves #​595.

Fixes

v0.21.0

Compare Source

Breaking Changes
Removed the update command

The update command is no more, you can (mostly) replace its usage with some new flags on the generate command.

If you had a package named my-api-client in the current working directory, the update command previously would update the my_api_client module within it. You can now almost perfectly replicate this behavior using openapi-python-client generate --meta=none --output-path=my-api-client/my_api_client --overwrite.

The only difference is that my-api-client would have run post_hooks in the my-api-client directory,
but generate will run post_hooks in the output-path directory.

Alternatively, you can now also run openapi-python-client generate --meta=<your-meta-type> --overwrite to regenerate
the entire client, if you don't care about keeping any changes you've made to the generated client.

Please comment on discussion #​824
(or a new discussion, as appropriate) to aid in designing future features that fill any gaps this leaves for you.

Features
Added an --output-path option to generate

Rather than changing directories before running generate you can now specify an output directory with --output-path.
Note that the project name will not be appended to the --output-path, whatever path you specify is where the
generated code will be placed.

Added an --overwrite flag to generate

You can now tell openapi-python-client to overwrite an existing directory, rather than deleting it yourself before
running generate.

v0.20.0

Compare Source

Breaking Changes
const values in responses are now validated at runtime

Prior to this version, const values returned from servers were assumed to always be correct. Now, if a server returns
an unexpected value, the client will raise a ValueError. This should enable better usage with oneOf.

PR #​1024. Thanks @​peter-greenatlas!

Switch YAML parsing to 1.2

This change switches the YAML parsing library to ruamel.yaml which follows the YAML 1.2 specification.
There are breaking changes from YAML 1.1 to 1.2,
though they will not affect most use cases.

PR #​1042 fixes #​1041. Thanks @​rtaycher!

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

v0.19.1

Compare Source

Features
Add config option to override content types

You can now define a content_type_overrides field in your config.yml:

content_type_overrides:
  application/zip: application/octet-stream

This allows openapi-python-client to generate code for content types it doesn't recognize.

PR #​1010 closes #​810. Thanks @​gaarutyunov!

Fixes
Add aliases to Client for pyright

This should resolve incompatibilities between the generated Client class and the pyright type checker.

PR #​1009 closes #​909. Thanks @​patrick91!

v0.19.0

Compare Source

Breaking Changes
Update PDM metadata syntax

Metadata generated for PDM will now use the new distribution = true syntax instead of package-type = "library".
New packages generated with --meta pdm will require PDM 2.12.0 or later to build.

Features
Add response content to UnexpectedStatus exception

The error message for UnexpectedStatus exceptions will now include the UTF-8 decoded (ignoring errors) body of the response.

PR #​989 implements #​840. Thanks @​harabat!

Fixes
Allow hyphens in path parameters

Before now, path parameters which were invalid Python identifiers were not allowed, and would fail generation with an
"Incorrect path templating" error. In particular, this meant that path parameters with hyphens were not allowed.
This has now been fixed!

PR #​986 fixed issue #​976. Thanks @​harabat!

[!WARNING]
This change may break custom templates, see this diff
if you have trouble upgrading.

v0.18.0

Compare Source

Breaking Changes
For custom templates, changed type of endpoint parameters

This does not affect projects that are not using --custom-template-path

The type of these properties on Endpoint has been changed from Dict[str, Property] to List[Property]:

  • path_parameters
  • query_parameters
  • header_parameters
  • cookie_parameters

If your templates are very close to the default templates, you can probably just remove .values() anywhere it appears.

The type of iter_all_parameters() is also different, you probably want list_all_parameters() instead.

Updated generated config for Ruff v0.2

This only affects projects using the generate command, not the update command. The pyproject.toml file generated which configures Ruff for linting and formatting has been updated to the 0.2 syntax, which means it will no longer work with Ruff 0.1.

Updated naming strategy for conflicting properties

While fixing #​922, some naming strategies were updated. These should mostly be backwards compatible, but there may be
some small differences in generated code. Make sure to check your diffs before pushing updates to consumers!

Features
support httpx 0.27 (#​974)
Fixes
Allow parameters with names differing only by case

If you have two parameters to an endpoint named mixedCase and mixed_case, previously, this was a conflict and the endpoint would not be generated.
Now, the generator will skip snake-casing the parameters and use the names as-is. Note that this means if neither of the parameters was snake case, neither will be in the generated code.

Fixes #​922 reported by @​macmoritz & @​benedikt-bartscher.

Fix naming conflicts with properties in models with mixed casing

If you had an object with two properties, where the names differed only by case, conflicting properties would be generated in the model, which then failed the linting step (when using default config). For example, this:

type: "object"
properties:
  MixedCase:
    type: "string"
  mixedCase:
    type: "string"

Would generate a class like this:

class MyModel:
    mixed_case: str
    mixed_case: str

Now, neither of the properties will be forced into snake case, and the generated code will look like this:

class MyModel:
    MixedCase: str
    mixedCase: str

v0.17.3

Compare Source

Fixes
Remove spurious field_dict.update({}) for types without properties (#​969)
Fix invalid type check for nested unions

Nested union types (unions of unions) were generating isinstance() checks that were not valid (at least for Python 3.9).

Thanks to @​codebutler for PR #​959 which fixes #​958 and #​967.

v0.17.2

Compare Source

Features
Add --meta=pdm option for generating PEP621 + PDM metadata

The default metadata is still --meta=poetry, which generates a pyproject.toml file with Poetry-specific metadata.
This change adds the --meta=pdm option which includes PDM-specific metadata, but also
standard PEP621
metadata. This may be useful as a starting point for other dependency managers & build tools (like Hatch).

Add original OpenAPI data attribute to Response object

PR #​767

In custom templates, you can now access a response.data attribute that contains the original OpenAPI definition of the
response (Response Object or Reference Object).

Include the UP rule for generated Ruff config

This enables pyupgrade-like improvements which should replace some
.format() calls with f-strings.

Fixes
Fix Ruff formatting for --meta=none

PR #​940 fixes issue #​939. Thanks @​satwell!

Due to the lack of pyproject.toml, Ruff was not getting configured properly when --meta=none.
As a result, it didn't clean up common generation issues like duplicate imports, which would then cause errors from
linters.

This is now fixed by changing the default post_hook to ruff check . --fix --extend-select=I when --meta=none.
Using generate --meta=none should now be almost identical to the code generated by update.

v0.17.1

Compare Source

Features
Export Unset types from generated types.py (#​927)
Generate properties for some boolean enums

If a schema has both type = "boolean" and enum defined, a normal boolean property will now be created.
Previously, the generator would error.

Note that the generate code will not correctly limit the values to the enum values. To work around this, use the
OpenAPI 3.1 const instead of enum to generate Python Literal types.

Thanks for reporting #​922 @​macmoritz!

Fixes
Do not stop generation for invalid enum values

This generator only supports enum values that are strings or integers.
Previously, this was handled at the parsing level, which would cause the generator to fail if there were any unsupported values in the document.
Now, the generator will correctly keep going, skipping only endpoints which contained unsupported values.

Thanks for reporting #​922 @​macmoritz!

Fix lists within unions

Fixes #​756 and #​928. Arrays within unions (which, as of 0.17 includes nullable arrays) would generate invalid code.

Thanks @​kgutwin and @​diesieben07!

Simplify type checks for non-required unions

v0.17.0

Compare Source

Breaking Changes
Removed query parameter nullable/required special case

In previous versions, setting either nullable: true or required: false on a query parameter would act like both were set, resulting in a type signature like Union[None, Unset, YourType]. This special case has been removed, query parameters will now act like all other types of parameters.

Renamed body types and parameters

PR #​900 addresses #​822.

Where previously there would be one body parameter per supported content type, now there is a single body parameter which takes a union of all the possible inputs. This correctly models the fact that only one body can be sent (and ever would be sent) in a request.

For example, when calling a generated endpoint, code which used to look like this:

post_body_multipart.sync_detailed(
    client=client,
    multipart_data=PostBodyMultipartMultipartData(),
)

Will now look like this:

post_body_multipart.sync_detailed(
    client=client,
    body=PostBodyMultipartBody(),
)

Note that both the input parameter name and the class name have changed. This should result in simpler code when there is only a single body type and now produces correct code when there are multiple body types.

Features
OpenAPI 3.1 support

The generator will now attempt to generate code for OpenAPI documents with versions 3.1.x (previously, it would exit immediately on seeing a version other than 3.0.x). The following specific OpenAPI 3.1 features are now supported:

  • null as a type
  • Arrays of types (e.g., type: [string, null])
  • const (defines Literal types)

The generator does not currently validate that the OpenAPI document is valid for a specific version of OpenAPI, so it may be possible to generate code for documents that include both removed 3.0 syntax (e.g., nullable) and new 3.1 syntax (e.g., null as a type).

Thanks to everyone who helped make this possible with discussions and testing, including:

Support multiple possible requestBody

PR #​900 addresses #​822.

It is now possible in some circumstances to generate valid code for OpenAPI documents which have multiple possible requestBody values. Previously, invalid code could have been generated with no warning (only one body could actually be sent).

Only one content type per "category" is currently supported at a time. The categories are:

  • JSON, like application/json
  • Binary data, like application/octet-stream
  • Encoded form data, like application/x-www-form-urlencoded
  • Files, like multipart/form-data
Fixes
Always use correct content type for requests

In previous versions, a request body that was similar to a known content type would use that content type in the request. For example application/json would be used for application/vnd.api+json. This was incorrect and could result in invalid requests being sent.

Now, the content type defined in the OpenAPI document will always be used.

v0.16.1

Compare Source

Features
Support httpx 0.26 (#​913)

v0.16.0

Compare Source

Breaking Changes
Switch from Black to Ruff for formatting

black is no longer a runtime dependency, so if you have them set in custom post_hooks in a config file, you'll need to make sure they're being installed manually. ruff is now installed and used by default instead.

Use Ruff instead of isort + autoflake at runtime

isort and autoflake are no longer runtime dependencies, so if you have them set in custom post_hooks in a config file, you'll need to make sure they're being installed manually. ruff is now installed and used by default instead.

Features
Support all text/* content types in responses

Within an API response, any content type which starts with text/ will now be treated the same as text/html already was—they will return the response.text attribute from the httpx Response.

Thanks to @​fdintino for the initial implementation, and thanks for the discussions from @​kairntech, @​rubenfiszel, and @​antoneladestito.

Closes #​797 and #​821.

Support application/octet-stream request bodies

Endpoints that accept application/octet-stream request bodies are now supported using the same File type as octet-stream responses.

Thanks to @​kgutwin for the implementation and @​rtaycher for the discussion!

PR #​899 closes #​588

Fixes
Remove useless pass statements from generated code

v0.15.2

Compare Source

Features
support httpx 0.25 (#​854)
Support content-type with attributes (#​655, #​809, #​858). Thanks @​sherbang!

v0.15.1

Compare Source

Features
Upgrade internal Pydantic use to v2. Thanks @​KristinnVikar! (#​779)
Fixes
Naming conflicts when properties are named "field" or "define" (#​781, #​793). Thanks @​david-dotorigin

v0.15.0

Compare Source

Breaking Changes
Minimum httpx version raised to 0.20

Some features of generated clients already failed at runtime when using httpx < 0.20, but now the minimum version is enforced at generation time.

Connections from clients no longer automatically close (PR #​775)

Client and AuthenticatedClient now reuse an internal httpx.Client (or AsyncClient)—keeping connections open between requests. This will improve performance overall, but may cause resource leaking if clients are not closed properly. The new clients are intended to be used via context managers—though for compatibility they don't have to be used with context managers. If not using a context manager, connections will probably leak. Note that once a client is closed (by leaving the context manager), it can no longer be used—and attempting to do so will raise an exception.

APIs should now be called like:

with client as client:
    my_api.sync(client)
    another_api.sync(client)

v0.14.1

Compare Source

Fixes

v0.14.0

Compare Source

Breaking Changes
  • Drop support for Python 3.7, put minimum version limit on Black (#​754)
Features
Fixes
  • pyproject_no_poetry.toml.jinja template can be used to configure black and isort (closes #​750) (#​751)

v0.13.4

Compare Source

Features

v0.13.3

Compare Source

Features
Fixes

v0.13.2

Compare Source

Features
  • Always generate enums with sorted members (#​728)
Fixes

v0.13.1

Compare Source

Features

v0.13.0

Compare Source

Breaking Changes
Fixes

v0.12.3

Compare Source

Features

v0.12.2

Compare Source

Fixes

v0.12.1

Compare Source

Fixes
  • Version bump due to PyPI error

v0.11.6

Compare Source

Features
Fixes

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/openapi-python-client-0.x branch from 2dafbd3 to 870fbd4 Compare November 20, 2022 11:11
@renovate renovate bot changed the title Update dependency openapi-python-client to v0.11.6 Update dependency openapi-python-client to v0.12.1 Nov 20, 2022
@renovate renovate bot force-pushed the renovate/openapi-python-client-0.x branch from 870fbd4 to 0f35c58 Compare March 12, 2023 07:10
@renovate renovate bot changed the title Update dependency openapi-python-client to v0.12.1 Update dependency openapi-python-client to v0.13.1 Mar 12, 2023
@renovate renovate bot force-pushed the renovate/openapi-python-client-0.x branch from 0f35c58 to bc819a6 Compare March 17, 2023 05:44
@renovate renovate bot force-pushed the renovate/openapi-python-client-0.x branch from bc819a6 to 77f8b63 Compare June 1, 2023 20:42
@renovate renovate bot changed the title Update dependency openapi-python-client to v0.13.1 Update dependency openapi-python-client to v0.14.1 Jun 1, 2023
@renovate renovate bot force-pushed the renovate/openapi-python-client-0.x branch from 77f8b63 to 134ad02 Compare July 23, 2023 21:15
@renovate renovate bot changed the title Update dependency openapi-python-client to v0.14.1 Update dependency openapi-python-client to v0.15.0 Jul 23, 2023
@renovate renovate bot force-pushed the renovate/openapi-python-client-0.x branch from 134ad02 to 55a8b5d Compare August 13, 2023 00:56
@renovate renovate bot changed the title Update dependency openapi-python-client to v0.15.0 Update dependency openapi-python-client to v0.15.1 Aug 13, 2023
@renovate renovate bot force-pushed the renovate/openapi-python-client-0.x branch from 55a8b5d to 1369496 Compare September 16, 2023 19:58
@renovate renovate bot changed the title Update dependency openapi-python-client to v0.15.1 Update dependency openapi-python-client to v0.15.2 Sep 16, 2023
@renovate renovate bot force-pushed the renovate/openapi-python-client-0.x branch from 1369496 to 64a7739 Compare December 7, 2023 04:45
@renovate renovate bot changed the title Update dependency openapi-python-client to v0.15.2 Update dependency openapi-python-client to v0.16.0 Dec 7, 2023
@renovate renovate bot force-pushed the renovate/openapi-python-client-0.x branch from 64a7739 to 2a3b7c5 Compare December 23, 2023 07:39
@renovate renovate bot changed the title Update dependency openapi-python-client to v0.16.0 Update dependency openapi-python-client to v0.16.1 Dec 23, 2023
@renovate renovate bot force-pushed the renovate/openapi-python-client-0.x branch from 2a3b7c5 to 4f181c2 Compare January 1, 2024 00:22
@renovate renovate bot changed the title Update dependency openapi-python-client to v0.16.1 Update dependency openapi-python-client to v0.17.0 Jan 1, 2024
@renovate renovate bot force-pushed the renovate/openapi-python-client-0.x branch from 4f181c2 to ed23316 Compare January 4, 2024 04:08
@renovate renovate bot changed the title Update dependency openapi-python-client to v0.17.0 Update dependency openapi-python-client to v0.17.1 Jan 4, 2024
@renovate renovate bot force-pushed the renovate/openapi-python-client-0.x branch from ed23316 to 83e6bca Compare January 15, 2024 02:09
@renovate renovate bot changed the title Update dependency openapi-python-client to v0.17.1 Update dependency openapi-python-client to v0.17.2 Jan 15, 2024
@renovate renovate bot force-pushed the renovate/openapi-python-client-0.x branch from 83e6bca to 6cb375a Compare February 20, 2024 03:38
@renovate renovate bot changed the title Update dependency openapi-python-client to v0.17.2 Update dependency openapi-python-client to v0.17.3 Feb 20, 2024
@renovate renovate bot force-pushed the renovate/openapi-python-client-0.x branch from 6cb375a to 526df43 Compare February 22, 2024 20:08
@renovate renovate bot changed the title Update dependency openapi-python-client to v0.17.3 Update dependency openapi-python-client to v0.18.0 Feb 22, 2024
@renovate renovate bot force-pushed the renovate/openapi-python-client-0.x branch from 526df43 to c0c7fb5 Compare March 6, 2024 05:15
@renovate renovate bot changed the title Update dependency openapi-python-client to v0.18.0 Update dependency openapi-python-client to v0.19.0 Mar 6, 2024
@renovate renovate bot force-pushed the renovate/openapi-python-client-0.x branch from c0c7fb5 to 2dfc3f7 Compare March 27, 2024 05:00
@renovate renovate bot changed the title Update dependency openapi-python-client to v0.19.0 Update dependency openapi-python-client to v0.19.1 Mar 27, 2024
@renovate renovate bot force-pushed the renovate/openapi-python-client-0.x branch from 2dfc3f7 to 3b2ed1e Compare May 18, 2024 23:54
@renovate renovate bot changed the title Update dependency openapi-python-client to v0.19.1 Update dependency openapi-python-client to v0.20.0 May 18, 2024
@renovate renovate bot force-pushed the renovate/openapi-python-client-0.x branch from 3b2ed1e to 12178c3 Compare June 8, 2024 22:35
@renovate renovate bot changed the title Update dependency openapi-python-client to v0.20.0 Update dependency openapi-python-client to v0.21.0 Jun 8, 2024
@renovate renovate bot force-pushed the renovate/openapi-python-client-0.x branch from 12178c3 to 1725d19 Compare June 15, 2024 22:10
@renovate renovate bot changed the title Update dependency openapi-python-client to v0.21.0 Update dependency openapi-python-client to v0.21.1 Jun 15, 2024
Signed-off-by: Renovate Bot <bot@renovateapp.com>
@renovate renovate bot force-pushed the renovate/openapi-python-client-0.x branch from 1725d19 to a41536d Compare July 20, 2024 20:14
@renovate renovate bot changed the title Update dependency openapi-python-client to v0.21.1 Update dependency openapi-python-client to v0.21.2 Jul 20, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

0 participants