Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR was created by Knope. Merging it will create a new release
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 fromDict[str, Property]
toList[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 wantlist_all_parameters()
instead.Updated generated config for Ruff v0.2
This only affects projects using the
generate
command, not theupdate
command. Thepyproject.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
andmixed_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:
Would generate a class like this:
Now, neither of the properties will be forced into snake case, and the generated code will look like this: