On Wed, Jun 10, 2020 at 4:09 PM J. Pic <j...@yourlabs.org> 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 -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/OK6D6VLH7ZPAUOHU3TLHWFVVBIBUNUZI/ Code of Conduct: http://python.org/psf/codeofconduct/