You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+50-51
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,33 @@
2
2
3
3
All notable changes to this project will be documented in this file.
4
4
5
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+
## 0.9.0
8
+
9
+
### Breaking Changes
10
+
11
+
- Some generated names will be different, solving some inconsistencies. (closes #369) (#375) Thanks @ramnes!
12
+
- Change reference resolution to use reference path instead of class name (fixes #342) (#366)
13
+
- If a schema references exactly one other schema in `allOf`, `oneOf`, or `anyOf` that referenced generated model will be used directly instead of generating a copy with another name. (#361)
14
+
- Attributes shadowing any builtin except `id` and `type` will now be renamed in generated clients (#360, #378, #407). Thanks @dblanchette and @forest-benchling!
15
+
16
+
### Features
17
+
18
+
- Allow httpx 0.18.x in generated clients (#400)
19
+
- Add summary attribute to Endpoint for use in custom templates (#404)
20
+
- Support common parameters for paths (#376). Thanks @ramnes!
21
+
- Add allOf support for model definitions (#98) (#321)
22
+
23
+
### Fixes
24
+
25
+
- Attempt to deduplicate endpoint parameters based on name and location (fixes #305) (#406)
26
+
- Names of classes without titles will no longer include ref path (fixes #397) (#405). Thanks @ramnes!
27
+
- Problems with enum defaults in allOf (#363). Thanks @csymeonides-mf
28
+
- Prevent duplicate return types in generated api functions (#365)
29
+
- Support empty strings in enums (closes #357) (#358). Thanks @ramnes!
30
+
- Allow passing data with files in multipart. (Fixes #351) (#355)
31
+
- Deserialization of unions (#332). Thanks @forest-benchling!
7
32
8
33
## 0.8.0 - 2021-02-19
9
34
@@ -14,10 +39,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
14
39
### Additions
15
40
16
41
- New `--meta` command line option for specifying what type of metadata should be generated:
42
+
17
43
-`poetry` is the default value, same behavior you're used to in previous versions
18
-
-`setup` will generate a pyproject.toml with no Poetry information, and instead create a `setup.py` with the
19
-
project info.
44
+
-`setup` will generate a pyproject.toml with no Poetry information, and instead create a `setup.py` with the project info.
20
45
-`none` will not create a project folder at all, only the inner package folder (which won't be inner anymore)
46
+
21
47
- Attempt to detect and alert users if they are using an unsupported version of OpenAPI (#281).
22
48
- The media type application/vnd.api+json will now be handled just like application/json (#307). Thanks @jrversteegh!
23
49
- Support passing models into query parameters (#316). Thanks @forest-benchling!
@@ -71,16 +97,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
71
97
72
98
- Any request/response field that is not `required` and wasn't specified is now set to `UNSET` instead of `None`.
73
99
- Values that are `UNSET` will not be sent along in API calls
74
-
- Schemas defined with `type=object` will now be converted into classes, just like if they were created as ref components.
75
-
The previous behavior was a combination of skipping and using generic Dicts for these schemas.
76
-
- Response schema handling was unified with input schema handling, meaning that responses will behave differently than before.
77
-
Specifically, instead of the content-type deciding what the generated Python type is, the schema itself will.
100
+
- Schemas defined with `type=object` will now be converted into classes, just like if they were created as ref components. The previous behavior was a combination of skipping and using generic Dicts for these schemas.
101
+
- Response schema handling was unified with input schema handling, meaning that responses will behave differently than before. Specifically, instead of the content-type deciding what the generated Python type is, the schema itself will.
102
+
78
103
- As a result of this, endpoints that used to return `bytes` when content-type was application/octet-stream will now return a `File` object if the type of the data is "binary", just like if you were submitting that type instead of receiving it.
104
+
79
105
- Instead of skipping input properties with no type, enum, anyOf, or oneOf declared, the property will be declared as `None`.
80
-
- Class (models and Enums) names will now contain the name of their parent element (if any). For example, a property
81
-
declared in an endpoint will be named like {endpoint*name}*{previous_class_name}. Classes will no longer be
82
-
deduplicated by appending a number to the end of the generated name, so if two names conflict with this new naming
83
-
scheme, there will be an error instead.
106
+
- Class (models and Enums) names will now contain the name of their parent element (if any). For example, a property declared in an endpoint will be named like {endpoint*name}*{previous*class*name}. Classes will no longer be deduplicated by appending a number to the end of the generated name, so if two names conflict with this new naming scheme, there will be an error instead.
84
107
85
108
### Additions
86
109
@@ -126,30 +149,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
126
149
127
150
### Breaking Changes
128
151
129
-
- Reorganized api calls in generated clients. `async_api` will no longer be generated. Each path operation will now
130
-
have it's own module under its tag. For example, if there was a generated function `api.my_tag.my_function()` it is
131
-
replaced with `api.my_tag.my_function.sync()`. The async version can be called with `asyncio()` instead of `sync()`.
132
-
(#167)
133
-
- Removed support for mutable default values (e.g. dicts, lists). They may be added back in a future version given enough
134
-
demand, but the existing implementation was not up to this project's standards. (#170)
135
-
- Removed generated `errors` module (and the `ApiResponseError` therein). Instead of raising an exception on failure,
136
-
the `sync()` and `asyncio()` functions for a path operation will return `None`. This means all return types are now
137
-
`Optional`, so mypy will require you to handle potential errors (or explicitly ignore them).
152
+
- Reorganized api calls in generated clients. `async_api` will no longer be generated. Each path operation will now have it's own module under its tag. For example, if there was a generated function `api.my_tag.my_function()` it is replaced with `api.my_tag.my_function.sync()`. The async version can be called with `asyncio()` instead of `sync()`. (#167)
153
+
- Removed support for mutable default values (e.g. dicts, lists). They may be added back in a future version given enough demand, but the existing implementation was not up to this project's standards. (#170)
154
+
- Removed generated `errors` module (and the `ApiResponseError` therein). Instead of raising an exception on failure, the `sync()` and `asyncio()` functions for a path operation will return `None`. This means all return types are now `Optional`, so mypy will require you to handle potential errors (or explicitly ignore them).
138
155
- Moved `models.types` generated module up a level, so just `types`.
139
156
- All generated classes that were `dataclass` now use the `attrs` package instead
140
157
141
158
### Additions
142
159
143
-
- Every generated API module will have a `sync_detailed()` and `asyncio_detailed()` function which work like their
144
-
non-detailed counterparts, but return a `types.Response[T]` instead of an `Optional[T]` (where T is the parsed body type).
145
-
`types.Response` contains `status_code`, `content` (bytes of returned content), `headers`, and `parsed` (the
146
-
parsed return type you would get from the non-detailed function). (#115)
147
-
- It's now possible to include custom headers and cookies in requests, as well as set a custom timeout. This can be done
148
-
either by directly setting those parameters on a `Client` (e.g. `my_client.headers = {"Header": "Value"}`) or using
149
-
a fluid api (e.g. `my_endpoint.sync(my_client.with_cookies({"MyCookie": "cookie"}).with_timeout(10.0))`).
150
-
- Unsupported content types or no responses at all will no longer result in an endpoint being completely skipped. Instead,
151
-
only the `detailed` versions of the endpoint will be generated, where the resulting `Response.parsed` is always `None`.
152
-
(#141)
160
+
- Every generated API module will have a `sync_detailed()` and `asyncio_detailed()` function which work like their non-detailed counterparts, but return a `types.Response[T]` instead of an `Optional[T]` (where T is the parsed body type). `types.Response` contains `status_code`, `content` (bytes of returned content), `headers`, and `parsed` (the parsed return type you would get from the non-detailed function). (#115)
161
+
- It's now possible to include custom headers and cookies in requests, as well as set a custom timeout. This can be done either by directly setting those parameters on a `Client` (e.g. `my_client.headers = {"Header": "Value"}`) or using a fluid api (e.g. `my_endpoint.sync(my_client.with_cookies({"MyCookie": "cookie"}).with_timeout(10.0))`).
162
+
- Unsupported content types or no responses at all will no longer result in an endpoint being completely skipped. Instead, only the `detailed` versions of the endpoint will be generated, where the resulting `Response.parsed` is always `None`. (#141)
153
163
- Support for Python 3.6 (#137 & #154)
154
164
- Support for enums with integer values
155
165
@@ -212,21 +222,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
212
222
213
223
### Changes
214
224
215
-
- When encountering a problem, the generator will now differentiate between warnings (things it was able to skip past)
216
-
and errors (things which halt generation altogether).
225
+
- When encountering a problem, the generator will now differentiate between warnings (things it was able to skip past) and errors (things which halt generation altogether).
217
226
218
227
### Additions
219
228
220
-
- The generator can now handle many more errors gracefully, skipping the things it can't generate and continuing
221
-
with the pieces it can.
229
+
- The generator can now handle many more errors gracefully, skipping the things it can't generate and continuing with the pieces it can.
222
230
- Support for Enums declared in "components/schemas" and references to them (#102).
223
231
- Generated clients can now be installed via pip (#120).
224
232
- Support for YAML OpenAPI documents (#111)
225
233
226
234
### Internal Changes
227
235
228
-
- Switched OpenAPI document parsing to use Pydantic based on a vendored version of
- Switched OpenAPI document parsing to use Pydantic based on a vendored version of [openapi-schema-pydantic](https://github.com/kuimono/openapi-schema-pydantic/) (#103).
230
237
- Tests can now be run on Windows.
231
238
232
239
## 0.4.2 - 2020-06-13
@@ -246,13 +253,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
246
253
247
254
### Breaking Changes
248
255
249
-
- Classes generated to be included within lists will now be named like <ListName>Item. For example, if a property
250
-
named "statuses" is an array of enum values, previously the `Enum` class declared would be called "Statuses". Now it
251
-
will be called "StatusesItem". If a "title" attribute was used in the OpenAPI document, that should still be respected
252
-
and used instead of the generated name. You can restore previous names by adding "StatusesItem" to the `class_overrides`
253
-
section of a config file.
254
-
- Clients now require httpx ^0.13.0 (up from ^0.12.1). See [httpx release notes](https://github.com/encode/httpx/releases/tag/0.13.0)
255
-
for details.
256
+
- Classes generated to be included within lists will now be named like <ListName>Item. For example, if a property named "statuses" is an array of enum values, previously the `Enum` class declared would be called "Statuses". Now it will be called "StatusesItem". If a "title" attribute was used in the OpenAPI document, that should still be respected and used instead of the generated name. You can restore previous names by adding "StatusesItem" to the `class_overrides` section of a config file.
257
+
- Clients now require httpx ^0.13.0 (up from ^0.12.1). See [httpx release notes](https://github.com/encode/httpx/releases/tag/0.13.0) for details.
256
258
257
259
### Additions
258
260
@@ -261,24 +263,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
261
263
- Support for any supported property within a list (array), including other lists.
262
264
- Support for Union types ("anyOf" in OpenAPI document)
263
265
- Support for more basic response types (integer, number, boolean)
264
-
- Support for duplicate enums. Instead of erroring, enums with the same name (title) but differing values
265
-
will have a number appended to the end. So if you have two conflicting enums named `MyEnum`, one of them
266
-
will now be named `MyEnum1`. Note that the order in which these are processed and therefore named is entirely
267
-
dependent on the order they are read from the OpenAPI document, so changes to the document could result
268
-
in swapping the names of conflicting Enums.
266
+
- Support for duplicate enums. Instead of erroring, enums with the same name (title) but differing values will have a number appended to the end. So if you have two conflicting enums named `MyEnum`, one of them will now be named `MyEnum1`. Note that the order in which these are processed and therefore named is entirely dependent on the order they are read from the OpenAPI document, so changes to the document could result in swapping the names of conflicting Enums.
269
267
270
268
### Changes
271
269
272
270
- The way most imports are handled was changed which _should_ lead to fewer unused imports in generated files.
273
271
- Better error messages
272
+
274
273
- Most error messages will contain some useful information about why it failed instead of a stack trace
275
274
- Client will still be generated if there are recoverable errors, excluding endpoints that had those errors
275
+
276
276
- Output from isort and black when generating will now be suppressed
277
277
278
278
### Fixes
279
279
280
-
- Defaults within models dataclasses for `Dict` or `List` properties will now be properly declared as a
281
-
`field` with the `default_factory` parameter to prevent errors related to mutable defaults.
280
+
- Defaults within models dataclasses for `Dict` or `List` properties will now be properly declared as a `field` with the `default_factory` parameter to prevent errors related to mutable defaults.
0 commit comments