sanic-org / sanic-ext

Extended Sanic functionality
https://sanic.dev/en/plugins/sanic-ext/getting-started.html
MIT License
50 stars 36 forks source link

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

Closed dmckeone closed 11 months ago

dmckeone commented 1 year ago

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.