Reputation: 10681
Just we can validate an incoming XML file based on the pre-defined schema, i.e. XSD or DTD, can we performation a validtaion on an incoming JSON object. Is there any JSON Schema Definition available?
Upvotes: 18
Views: 5875
Reputation: 770
OpenAPI is probably the best answer to this now. It's supported in .Net 5.0. This seems to be the industry direction.
Upvotes: 1
Reputation: 116730
http://json-schema.org/implementations.html gives a list of validators.
There are 32 validators listed as of November 2015. One of them is available as an interactive online tool: http://www.jsonschemavalidator.net/
The others are grouped by implementation language.
In many cases, an indication of whether the validator supports the current version of JSON Schema is also given.
Upvotes: 1
Reputation: 1828
There's a new library, json-gate, that does the trick. (Full disclosure: I am the author.)
It is similar to JSV and others, but it has several advantages:
* It is not fast so much as JSV is incredibly slow. My test shows JSV to be 30 (!) times slower than json-gate. This result is consistent with Robert Schultz's tests, which compare JSV against other libraries.
Upvotes: 1
Reputation: 17423
There are few libraries, which validate data against JSON Schema....
Upvotes: 1
Reputation: 1038790
There's a working draft of a JSON schema. You could also take a look at Cerny.
Upvotes: 10