openapi-schema-pydantic icon indicating copy to clipboard operation
openapi-schema-pydantic copied to clipboard

feat: Add datatype enum.

Open mike-oakley opened this issue 2 years ago • 4 comments

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.

mike-oakley avatar May 13 '22 16:05 mike-oakley

Hey @kuimono any comments on this and #13?

mike-oakley avatar Jun 04 '22 15:06 mike-oakley

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.

kuimono avatar Jun 04 '22 15:06 kuimono

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 avatar Jun 04 '22 15:06 mike-oakley

@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).

Goldziher avatar Aug 04 '22 16:08 Goldziher