Commit c28226e
chore: prepare release 0.18.0 (#975)
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 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
```
Co-authored-by: GitHub <github-actions@github.com>1 parent eeb1326 commit c28226e
File tree
7 files changed
+71
-76
lines changed- .changeset
7 files changed
+71
-76
lines changedLines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 0 additions & 18 deletions
This file was deleted.
This file was deleted.
Lines changed: 0 additions & 8 deletions
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
16 | 86 | | |
17 | 87 | | |
18 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
0 commit comments