3 ms·
We wish a better standard would emerge for JSON Schema as well. We had to choose from just a few Validators that would grok the style of $ref we used - that pa
by EdSharkey 10y ago
We wish a better standard would emerge for JSON Schema as well. We had to choose from just a few Validators that would grok the style of $ref we used - that part of JSON Schema is woefully underspecified. Of the few validators that we found, we found WILDLY differing performance and validation failure message quality.
The fastest JavaScript implementation we found was is-my-json-valid, but its error messages are nearly useless.
The best error messages (and IMHO conformance to the spec) came from fge's json-schema-validator, which is a Java implementation. The test suite on this impl is impressive. The validation failure messages are excruciatingly long and detailed if you have a large schema, but help a lot with debugging your document generators. But, the performance is awful. If you do any regex patterns, it shells to a Rhino script to to the validations which are predictably catastrophic for performance, making that validator unusable in production environments.
JSON Schema must be very difficult to optimize the way it is structured, which tells me it is probably a badly conceived specification.
JSON in general needs the kind of tooling and library love that XML got back in the day. I've searched in vain forever just for a great query language for JSON documents. I'm convinced that JavaScript+Lodash is the query language for JSON, to which I say meh. And, I'd love to see a first-class JSON streaming API and tooling/libraries (similar to STaX in the good old days of XML). How is anyone supposed to work with huge documents??
We're simply not giving ourselves enough tools, it's all very loosey goosey in JavaScript land.