All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Improved trailing comma handling in endpoint generation (#178 & #179). Thanks @dtkav!
Optionalis now properly imported fornullablefields (#177 & #180). Thanks @dtkav!
- 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!
- 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)
- 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).
- Added support for header parameters (#117)
- JSON bodies will now be assigned correctly in generated clients(#139 & #147). Thanks @pawamoy!
- Added
project_name_overrideandpackage_name_overrideconfig 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)
- 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)
- 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).
- The generator can now handle many more errors gracefully, skipping the things it can't generate and continuing with the pieces it can.
- Support for Enums declared in "components/schemas" and references to them (#102).
- Generated clients can now be installed via pip (#120).
- Support for YAML OpenAPI documents (#111)
- Switched OpenAPI document parsing to use Pydantic based on a vendored version of openapi-schema-pydantic (#103).
- Tests can now be run on Windows.
- Support for responses with no content (#63 & #66). Thanks @acgray!
- Support for custom string formats (#64 & #65). Thanks @acgray!
- Support for Python 3.7 (#58)
- Classes generated to be included within lists will now be named like Item. For example, if a property
named "statuses" is an array of enum values, previously the
Enumclass 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 theclass_overridessection of a config file. - Clients now require httpx ^0.13.0 (up from ^0.12.1). See httpx release notes for details.
- Support for binary format strings (file payloads)
- Support for multipart/form bodies
- Support for any supported property within a list (array), including other lists.
- Support for Union types ("anyOf" in OpenAPI document)
- Support for more basic response types (integer, number, boolean)
- 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 namedMyEnum1. 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.
- The way most imports are handled was changed which should lead to fewer unused imports in generated files.
- Better error messages
- Most error messages will contain some useful information about why it failed instead of a stack trace
- Client will still be generated if there are recoverable errors, excluding endpoints that had those errors
- Output from isort and black when generating will now be suppressed
- Defaults within models dataclasses for
DictorListproperties will now be properly declared as afieldwith thedefault_factoryparameter to prevent errors related to mutable defaults.
- Link to the GitHub repository from PyPI (#26). Thanks @theY4Kman!
- Support for date properties (#30, #37). Thanks @acgray!
- Allow naming schemas by property name and Enums by title (#21, #31, #38). Thanks @acgray!
- Fixed some typing issues in generated clients and incorporate mypy into end to end tests (#32). Thanks @acgray!
- Properly handle camelCase endpoint names and properties (#29, #36). Thanks @acgray!
- Fixed import of errors.py in generated api modules
- Support for lists of Enums
- Add config for black to generated pyproject.toml
- Update Typer dependency to 0.1.0 and remove click-completion dependency (#19)
- Switched to httpx from requests for both this tool and generated clients (#15)
--versionoption to print the version of openapi-python-client and exit--configoption for passing a config.yml file to override generated class names (#9)- Generated clients will now have some basic Poetry usage in their README.md (#13)
- Generated clients will now have an async_api module for async versions of every function in the api module (#16)
- Generated clients will be auto-formatted with isort and black (#12)
- Generated clients will have a .gitignore covering some basics (#14)
- A number of additions to the README including recommending pipx (#20)
- Improve handling of optional properties in generated
to_dictfunction for models - Add PEP 561 marker file (py.typed) to generated packages
- Fix mypy issue in generated models
from_dictwith datetime or reference properties - Generated clients now raise an
ApiResponseErrorif they receive a response that was not declared - Stop including optional query parameters when value is set to None
- Added an
updatecommand to update a previously generated client - Added click-completion for installable tab completion in most shells
- Initial Release