Skip to content
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

Add msgspec support for openapi.Component and @validate() #229

Merged
merged 6 commits into from
Dec 13, 2023

Conversation

dmckeone
Copy link
Contributor

@dmckeone dmckeone commented Sep 14, 2023

Add support for using msgspec in openapi.Component and with validation -- @validate()

I also parameterized the tests in test_validation to verify that msgspec worked, but I also added the equivalent attrs and pydantic tests as well to make sure that all cases were covered.

If I wasn't sure about compatibility, I used inline imports -- as opposed to top-of-file imports -- for msgspec.

David McKeone added 5 commits September 14, 2023 11:09
Validation only occurs when using msgspec.convert, so type errors would not be properly caught without the new _msgspec_validate_instance method
@ahopkins ahopkins merged commit e3ff389 into sanic-org:main Dec 13, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants