openapi-schema-pydantic
openapi-schema-pydantic copied to clipboard
feat: Add datatype enum.
Inspired by upstream changes: https://github.com/openapi-generators/openapi-python-client/pull/478
Adds a DataType enum. This:
Improves validation by rejecting invalid keywords which don't match the spec at parse-time. Improves developer experience, allows IDE autocompletion to show allowed values.
Hey @kuimono any comments on this and #13?
Adding the DataType enum could be a breaking change for users who are only using it as string.
Therefore this PR maybe pending for next major release.
I would argue that it will only be a breaking change if using it to parse schemas that are invalid from the OpenAPI spec 😉, but I guess you are technically right. Any idea when you'll release the next major? I was looking to get these changes in to allow this project to be a non-vendored dependency in the aforementioned downstream project 🤔.
@mike-oakley -> youre welcome to submit any and all improvements to https://github.com/starlite-api/pydantic-openapi-schema, we'll gladly release this PR (except for code duplication, which we should strive to reduce when possible).