tefra / xsdata-pydantic

Naive XML & JSON Bindings for python pydantic classes!
https://xsdata-pydantic.readthedocs.io/
MIT License
52 stars 10 forks source link

Hints for usage with fastapi #8

Closed jensens closed 2 years ago

jensens commented 2 years ago

I used this code to generate pydantic schemas intended for use with fastapi. Background is, I receive data from Exlibris Alma Webhooks. The schema is available as XSD only (no JSON schemas). With this great tool here I directly generate pydantic schemas for fastapi Thanks so much! Anyway, they do not work out-of-the-box, some manual steps needed:

Now it at least loads the model and it seems incoming JSON data is validated as expected.

tefra commented 2 years ago

Yeah there are some blocking issues with pydantic and I can't really release this plugin yet.

Thanks for giving it a try and for your feedback!

tefra commented 2 years ago

The plugin is now released, as it was, one of the most major issues with pydantic was resolved in a recent release, if there are any more issues please let me know!