Skip to content

Releases: openapi-generators/openapi-python-client

0.6.0 - 2020-09-21

21 Sep 21:20
Compare
Choose a tag to compare

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_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)
  • 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 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).
  • Moved models.types generated module up a level, so just types.
  • All generated classes that were dataclass now use the attrs package instead

Additions

  • 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)
  • 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 detailed versions of the endpoint will be generated, where the resulting Response.parsed is always None.
    (#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

10 Sep 19:34
Compare
Choose a tag to compare
Pre-release

Changes since previous alpha

Fixes

0.6.0-alpha.3 - 2020-09-06

07 Sep 00:34
Compare
Choose a tag to compare
Pre-release

Changes since last alpha

Breaking Changes

  • All generated classes that were dataclass now use the attrs package instead

Additions

  • Support for Python 3.6 (#137 & #154)
  • Support for enums with integer values

0.5.5 - 2020-09-04

04 Sep 14:01
Compare
Choose a tag to compare

Fixes

  • Improved trailing comma handling in endpoint generation (#178 & #179). Thanks @dtkav!
  • Optional is now properly imported for nullable fields (#177 & #180). Thanks @dtkav!

0.6.0-alpha.2 - 2020-09-04

04 Sep 14:06
Compare
Choose a tag to compare
Pre-release

Only includes changes since 0.6.0-alpha.1

Included from 0.5.5

  • Improved trailing comma handling in endpoint generation (#178 & #179). Thanks @dtkav!
  • Optional is now properly imported for nullable fields (#177 & #180). Thanks @dtkav!

0.5.4 - 2020-08-29

29 Aug 15:35
Compare
Choose a tag to compare

Additions

  • Support for octet-stream content type (#116)
  • Support for nullable (#99)
  • Union properties can be defined using oneOf (#98)
  • Support for lists of strings, integers, floats and booleans as responses (#165). Thanks @Maistho!

0.6.0-alpha.1

29 Aug 17:22
Compare
Choose a tag to compare
0.6.0-alpha.1 Pre-release
Pre-release

Breaking Changes

  • 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)
  • 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 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).
  • Moved models.types generated module up a level, so just types.
  • Client and AuthenticatedClient are now declared using the attrs package instead of builtin dataclass

Additions

  • 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)
  • 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 detailed versions of the endpoint will be generated, where the resulting Response.parsed is always None. (#141)

Changes

  • The format of any errors/warnings has been spaced out a bit.

0.5.3 - 2020-08-13

13 Aug 17:22
0230ec5
Compare
Choose a tag to compare

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 RefProperty that 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 integer type property, and the function for an endpoint using it would fail to generate and be skipped).

Additions

  • Added support for header parameters (#117)

Fixes

  • JSON bodies will now be assigned correctly in generated clients(#139 & #147). Thanks @pawamoy!

0.5.2 - 2020-08-06

06 Aug 17:55
Compare
Choose a tag to compare

Additions

  • Added project_name_override and package_name_override config options to override the name of the generated project/package (#123)
  • The generated library's version is now the same as the OpenAPI doc's version (#134)

0.5.1 - 2020-08-05

05 Aug 17:37
Compare
Choose a tag to compare

Fixes

  • Relative paths are now allowed in securitySchemes/OAuthFlow/tokenUrl (#130).
  • Schema validation errors will no longer print a stack trace (#131).
  • Invalid YAML/URL will no longer print stack trace (#128)