-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add OpenAPI Specification 3.1.0 support #230
Conversation
OAS 3.1.0 support introduced in 5.0.0 Signed-off-by: Mike Fiedler <[email protected]>
Signed-off-by: Mike Fiedler <[email protected]>
Adapt to new JSONSchema style. Update test to remove `decode()` since it's cast to a string from binary for us. Signed-off-by: Mike Fiedler <[email protected]>
Signed-off-by: Mike Fiedler <[email protected]>
The diff doesn't look too complex, which makes me wonder if we should keep support for OpenAPI v3.0. Can you give it a try to see how doable it is? |
In my tests, I couldn't get the current code to fail with an openapi 3.0.0 spec, so it's possible that the openapi-core handles that for us transparently? |
I imagine our specs are so simple that they are compatible with both v3.0 and v3.1. We'd need to add a test spec that includes some v3.1-only feature. Additionally, openapi-core seems to be smart enough to use the correct version of the unmarshaller: https://github.com/python-openapi/openapi-core/blob/32ce65739531eea90220aeabbee72096818b9d05/docs/customizations/request_unmarshaller_cls.rst. So I guess we could do the same, use |
Signed-off-by: Mike Fiedler <[email protected]>
I had previously added a test for an OAS3.1-specific feature (the binary format change). I added another test case and app to show the breakage, and then made a dispatch based on the detected spec versions. It's not super beautiful, but it works! |
Signed-off-by: Mike Fiedler <[email protected]>
Fresh coat of paint. Addresses minor inconsistencies, as surfaced by markdownlint and my own observations. Signed-off-by: Mike Fiedler <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Updates library to OAS3.1.0
pyramid_openapi3/tests/test_contenttypes.py
to express the new binary format