On Wed, Jun 10, 2020 at 4:09 PM J. Pic <[email protected]> wrote: > Good point, but then I'm not sure the decoder could be used for untrusted > json anymore. > > Another solution would be to generate a schema in a separate variable, > which would represent the JSON structure with Python types. >
For that there are many existing libraries. You might like one of my recent projects: https://github.com/alexmojaki/datafunctions or: https://pydantic-docs.helpmanual.io/ https://github.com/lidatong/dataclasses-json <https://github.com/lidatong/dataclasses-json#Overriding> https://github.com/ltworf/typedload/
_______________________________________________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/OK6D6VLH7ZPAUOHU3TLHWFVVBIBUNUZI/ Code of Conduct: http://python.org/psf/codeofconduct/
