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
This commit was created on GitHub.com and signed with GitHub’s verified signature.
The key has expired.
Breaking Changes
Any request/response field that is not required and wasn't specified is now set to UNSET instead of None.
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 a File object if the type of the data is "binary", just like if you were submitting that type instead of receiving it.
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 to transform and initial_value param to construct to improve flexibility (#241 - Thanks @packyg!).
Fixes
Fixed spacing and generation of properties of type Union in generated models (#241 - Thanks @packyg!).
Fixed usage instructions in generated README.md (#247 - Thanks @theFong!).