DEV Community

Discussion on: INSTANTLY PARSE JSON

Collapse
 
michaelcurrin profile image
Michael Currin • Edited

Hmm interesting idea. I don't know if I have use-case for it. What kind of projects are you using it for?

I'm happy with keeping my objects as a list or dict of strings or numbers, without converting it to a class instance.

If I do want to enforce strict structure and types at runtime when parsing JSON, so I know it is safe to use, I'd rather rely on a library do to do that. So I don't need to generate and copy boilerplate from the tool provided, which has to be maintained and repeated on each project of mine.

e.g. jsonschema in Python - pass it a schema validation of the types (rather than inferring from the values). And it will raise an error if the format of your data is bad.

python-jsonschema.readthedocs.io/e...

Collapse
 
amritanshu profile image
Amritanshu Dev Rawat

Nice :)