2 ms·
Devs who think JSON is wonderful to work with probably think so because they're using a dynamically typed language. The advantage of a schema is you can valida
by nly 10y ago
Devs who think JSON is wonderful to work with probably think so because they're using a dynamically typed language.
The advantage of a schema is you can validate your data and move to static typing in only a few lines of code. It's for this reason that I think the best option these days is to just use something like protobufs v3, which has a stable JSON serialization and a sensible schema specification.
But even for objecty data, rather than "documents", XML doesn't have to be clumsy. Checkout the code samples here for C++
http://www.codesynthesis.com/products/xsd/ http://www.codesynthesis.com/products/xsd/