6 ms·
> The insistence of the JSON-people to sabotage any kind of data validation is absurd to me. I don't understand what you mean by this. JSON supports schemas wh
by fragmede 3y ago
> The insistence of the JSON-people to sabotage any kind of data validation is absurd to me.
I don't understand what you mean by this. JSON supports schemas which can be used to validate input. It's not super advanced, but it's functional.
- xnorswap 3y agoJSON schema aren't part of the JSON definition, and JSON itself suffers from lacking good handling of types such as dates. JSON itself succeeds as a way to represent JavaScript objects but it is far less useful than XML for representing custom types, which are easily enforced through XML Schema. JSON Schema adds some of this, but it isn't a standard (yet).
- sacado2 3y agoXML schemas aren't part of the XML definition either, although, granted, they're an official recommendation too.
- lexicality 3y agoHaving written a bunch of XML schemas and a bunch of JSON schemas at the same time while integrating multiple third party APIs, I can unreservedly say that JSON schema is awful. It just about works, but it's horrible to write and horrible to maintain. What you can actually do with the validation is surprisingly limited in some forms and the fact that you have to write JSON to write the schema shows just how non-user-friendly JSON is. A friend told me that she writes JSON schemas in YAML and then uses a build step to downgrade that to JSON for the actual validator. I wish I'd thought of that.
- alphager 3y agoThe JSON people were adamant about discouraging what https://json-schema.org/ https://json-schema.org/ ended up being. There's a reason JSON.org never linked to it (even back when they had a full screen of links at the bottom of their page: https://web.archive.org/web/20180727095653/http://www.json.org/ https://web.archive.org/web/20180727095653/http://www.json.o... )