From cf191b84f7b330f2d1d8e01bfbb0868193ea7691 Mon Sep 17 00:00:00 2001 From: GitHub Date: Thu, 22 Feb 2024 01:01:35 +0000 Subject: [PATCH] chore: prepare release 0.18.0 --- ...eters_with_names_differing_only_by_case.md | 10 --- ...ing_conflicts_with_properties_in_models.md | 32 --------- ...tes_changed_type_of_endpoint_parameters.md | 18 ----- .../updated_generated_config_for_ruff_v02.md | 7 -- ...ing_strategy_for_conflicting_properties.md | 8 --- CHANGELOG.md | 70 +++++++++++++++++++ pyproject.toml | 2 +- 7 files changed, 71 insertions(+), 76 deletions(-) delete mode 100644 .changeset/allow_parameters_with_names_differing_only_by_case.md delete mode 100644 .changeset/fix_naming_conflicts_with_properties_in_models.md delete mode 100644 .changeset/for_custom_templates_changed_type_of_endpoint_parameters.md delete mode 100644 .changeset/updated_generated_config_for_ruff_v02.md delete mode 100644 .changeset/updated_naming_strategy_for_conflicting_properties.md diff --git a/.changeset/allow_parameters_with_names_differing_only_by_case.md b/.changeset/allow_parameters_with_names_differing_only_by_case.md deleted file mode 100644 index 6e0cd803e..000000000 --- a/.changeset/allow_parameters_with_names_differing_only_by_case.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -default: patch ---- - -# 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. diff --git a/.changeset/fix_naming_conflicts_with_properties_in_models.md b/.changeset/fix_naming_conflicts_with_properties_in_models.md deleted file mode 100644 index 683803a78..000000000 --- a/.changeset/fix_naming_conflicts_with_properties_in_models.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -default: patch ---- - -# 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: - -```yaml -type: "object" -properties: - MixedCase: - type: "string" - mixedCase: - type: "string" -``` - -Would generate a class like this: - -```python -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: - -```python -class MyModel: - MixedCase: str - mixedCase: str -``` \ No newline at end of file diff --git a/.changeset/for_custom_templates_changed_type_of_endpoint_parameters.md b/.changeset/for_custom_templates_changed_type_of_endpoint_parameters.md deleted file mode 100644 index e6fb93c75..000000000 --- a/.changeset/for_custom_templates_changed_type_of_endpoint_parameters.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -default: major ---- - -# 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. diff --git a/.changeset/updated_generated_config_for_ruff_v02.md b/.changeset/updated_generated_config_for_ruff_v02.md deleted file mode 100644 index 88517d56c..000000000 --- a/.changeset/updated_generated_config_for_ruff_v02.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -default: major ---- - -# 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. diff --git a/.changeset/updated_naming_strategy_for_conflicting_properties.md b/.changeset/updated_naming_strategy_for_conflicting_properties.md deleted file mode 100644 index 5660fed07..000000000 --- a/.changeset/updated_naming_strategy_for_conflicting_properties.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -default: major ---- - -# 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! diff --git a/CHANGELOG.md b/CHANGELOG.md index 16b5a2bf9..b94524000 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,76 @@ 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.18.0 (2024-02-22) + +### 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: + +```yaml +type: "object" +properties: + MixedCase: + type: "string" + mixedCase: + type: "string" +``` + +Would generate a class like this: + +```python +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: + +```python +class MyModel: + MixedCase: str + mixedCase: str +``` + ## 0.17.3 (2024-02-20) ### Fixes diff --git a/pyproject.toml b/pyproject.toml index 6ebc0d91d..af87c0d2b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ dependencies = [ "typing-extensions>=4.8.0,<5.0.0", ] name = "openapi-python-client" -version = "0.17.3" +version = "0.18.0" description = "Generate modern Python clients from OpenAPI" keywords = [ "OpenAPI",