Releases: openapi-generators/openapi-python-client
Releases · openapi-generators/openapi-python-client
0.8.0 - 2021-02-19
Breaking Changes
- Generated clients will no longer pass through
None
to query parameters. Previously, any query params set toNone
would surface as empty strings (per the default behavior ofhttpx
). This is contrary to the defaults indicated by the OpenAPI 3.0.3 spec. Ommitting these parameters makes us more compliant. If you require a style ofnull
to be passed to your query parameters, please request support for the OpenAPI "style" attribute. Thank you to @forest-benchling and @bowenwr for a ton of input on this.
Additions
- New
--meta
command line option for specifying what type of metadata should be generated:poetry
is the default value, same behavior you're used to in previous versionssetup
will generate a pyproject.toml with no Poetry information, and instead create asetup.py
with the
project info.none
will not create a project folder at all, only the inner package folder (which won't be inner anymore)
- Attempt to detect and alert users if they are using an unsupported version of OpenAPI (#281).
- The media type application/vnd.api+json will now be handled just like application/json (#307). Thanks @jrversteegh!
- Support passing models into query parameters (#316). Thanks @forest-benchling!
- Add support for cookie parameters (#326).
- New
--file-encoding
command line option (#330). Sets the encoding used when writing generated files (defaults to utf-8). Thanks @dongfangtianyu!
Changes
- Lowered the minimum version of
python-dateutil
to 2.8.0 for improved compatibility (#298 & #299). Thanks @bowenwr! - The
from_dict
method on generated models is now a@classmethod
instead of@staticmethod
(#215 & #292). Thanks @forest-benchling! - Renamed all templates to end in
.jinja
, and all python-templates to end in.py.jinja
to fix confusion with the latest version of mypy. Note this will break existing custom templates until you update your template file names.
Fixes
- Endpoint tags are now sanitized during parsing to fix an issue where
My Tag
andMyTag
are seen as two different tags but are then later unified, causing errors when creating directories. Thanks @p1-ra! (#328) - Parser will softly ignore value error during schema responses' status code convertion from string to integer (not a number). Errors will be reported to the end user and parsing will continue to proceed (#327).
- The generated
from_dict
andto_dict
methods of models will now properly handlenullable
andnot required
properties that are themselves generated models (#315). Thanks @forest-benchling! - Fixed a typo in the async example in generated README.md files (#337). Thanks @synchronizing!
- Fix deserialization of
None
andUnset
properties for all types by unifying the checks (#334). Thanks @forest-benchling! - If duplicate model names are detected during generation, you'll now get an error message instead of broken code (#336). Thanks @forest-benchling!
- Fixes
Enum
deserialization when the value isUNSET
(#306). Thanks @bowenwr!
0.7.3 - 2020-12-21
0.7.2 - 2020-12-08
0.7.1 - 2020-12-08
Additions
- Support for additionalProperties attribute in OpenAPI schemas and "free-form" objects by adding an
additional_properties
attribute to generated models. COMPATIBILITY NOTE: this will prevent any model property with a name that would be coerced to "additional_properties" in the generated client from generating properly (#218 & #252). Thanks @packyg!
Fixes
0.7.0 - 2020-11-25
Breaking Changes
- Any request/response field that is not
required
and wasn't specified is now set toUNSET
instead ofNone
. - Values that are
UNSET
will not be sent along in API calls - 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. - 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.- As a result of this, endpoints that used to return
bytes
when content-type was application/octet-stream will now return aFile
object if the type of the data is "binary", just like if you were submitting that type instead of receiving it.
- As a result of this, endpoints that used to return
- Instead of skipping input properties with no type, enum, anyOf, or oneOf declared, the property will be declared as
None
. - 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.
Additions
- Added a
--custom-template-path
option for providing custom jinja2 templates (#231 - Thanks @erichulburd!). - Better compatibility for "required" (whether or not the field must be included) and "nullable" (whether or not the field can be null) (#205 & #208). Thanks @bowenwr & @emannguitar!
- Support for all the same schemas in responses as are supported in parameters.
- In template macros: added
declare_type
param totransform
andinitial_value
param toconstruct
to improve flexibility (#241 - Thanks @packyg!).
Fixes
0.7.0-rc.3 - 2020-11-24
0.7.0-rc.2
0.7.0-rc.1 - 2020-11-11
Fixed issue with non-required fields in a model not being marked as such
0.7.0-rc.0 - 2020-11-10
Breaking Changes
- Any request/response field that is not
required
and wasn't specified is now set toUNSET
instead ofNone
. - Values that are
UNSET
will not be sent along in API calls - 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. - 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.- As a result of this, endpoints that used to return
bytes
when content-type was application/octet-stream will now return aFile
object if the type of the data is "binary", just like if you were submitting that type instead of receiving it.
- As a result of this, endpoints that used to return
- Instead of skipping input properties with no type, enum, anyOf, or oneOf declared, the property will be declared as
None
. - 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.
Additions
- Added a
--custom-template-path
option for providing custom jinja2 templates (#231 - Thanks @erichulburd!). - Better compatibility for "required" (whether or not the field must be included) and "nullable" (whether or not the field can be null) (#205 & #208). Thanks @bowenwr & @emannguitar!
- Support for all the same schemas in responses as are supported in parameters.