Releases: openapi-generators/openapi-python-client
Releases · openapi-generators/openapi-python-client
0.6.0 - 2020-09-21
This release is the culmination of a ton of feedback around the structure of generated clients. A huge thank you to everyone involved in making these improvements. That being said, clients generated with this release are not compatible with clients generated with 0.5.x. Use care when updating existing clients.
Breaking Changes
- Reorganized api calls in generated clients.
async_apiwill no longer be generated. Each path operation will now
have it's own module under its tag. For example, if there was a generated functionapi.my_tag.my_function()it is
replaced withapi.my_tag.my_function.sync(). The async version can be called withasyncio()instead ofsync().
(#167) - 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) - Removed generated
errorsmodule (and theApiResponseErrortherein). Instead of raising an exception on failure,
thesync()andasyncio()functions for a path operation will returnNone. This means all return types are now
Optional, so mypy will require you to handle potential errors (or explicitly ignore them). - Moved
models.typesgenerated module up a level, so justtypes. - All generated classes that were
dataclassnow use theattrspackage instead
Additions
- Every generated API module will have a
sync_detailed()andasyncio_detailed()function which work like their
non-detailed counterparts, but return atypes.Response[T]instead of anOptional[T](where T is the parsed body type).
types.Responsecontainsstatus_code,content(bytes of returned content),headers, andparsed(the
parsed return type you would get from the non-detailed function). (#115) - 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 aClient(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))). - Unsupported content types or no responses at all will no longer result in an endpoint being completely skipped. Instead,
only thedetailedversions of the endpoint will be generated, where the resultingResponse.parsedis alwaysNone.
(#141) - Support for Python 3.6 (#137 & #154)
- Support for enums with integer values
Changes
- The format of any errors/warnings has been spaced out a bit.
0.6.0-alpha.4 - 2020-09-10
0.6.0-alpha.3 - 2020-09-06
0.5.5 - 2020-09-04
0.6.0-alpha.2 - 2020-09-04
0.5.4 - 2020-08-29
0.6.0-alpha.1
Breaking Changes
- Reorganized api calls in generated clients.
async_apiwill no longer be generated. Each path operation will now have it's own module under its tag. For example, if there was a generated functionapi.my_tag.my_function()it is replaced withapi.my_tag.my_function.sync(). The async version can be called withasyncio()instead ofsync(). (#167) - 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)
- Removed generated
errorsmodule (and theApiResponseErrortherein). Instead of raising an exception on failure, thesync()andasyncio()functions for a path operation will returnNone. This means all return types are nowOptional, so mypy will require you to handle potential errors (or explicitly ignore them). - Moved
models.typesgenerated module up a level, so justtypes. ClientandAuthenticatedClientare now declared using theattrspackage instead of builtindataclass
Additions
- Every generated API module will have a
sync_detailed()andasyncio_detailed()function which work like their non-detailed counterparts, but return atypes.Response[T]instead of anOptional[T](where T is the parsed body type).types.Responsecontainsstatus_code,content(bytes of returned content),headers, andparsed(the parsed return type you would get from the non-detailed function). (#115) - 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))). - Unsupported content types or no responses at all will no longer result in an endpoint being completely skipped. Instead, only the
detailedversions of the endpoint will be generated, where the resultingResponse.parsedis alwaysNone. (#141)
Changes
- The format of any errors/warnings has been spaced out a bit.
0.5.3 - 2020-08-13
Security
- All values that become file/directory names are sanitized to address path traversal vulnerabilities (CVE-2020-15141)
- All values that get placed into python files (everything from enum names, to endpoint descriptions, to default values) are validated and/or saniziatied to address arbitrary code execution vulnerabilities (CVE-2020-15142)
Changes
- Due to security concerns/implementation complexities, default values are temporarily unsupported for any
RefPropertythat doesn't refer to an enum. - Defaults for properties must now be valid values for their respective type (e.g. "example string" is an invalid default for an
integertype property, and the function for an endpoint using it would fail to generate and be skipped).
Additions
- Added support for header parameters (#117)