Reputation: 13632
This package can be used to validate that a given instance I matches a schema S: https://github.com/Julian/jsonschema/tree/master/jsonschema
I am looking for another package or method to tell whether a given schema S is valid JSON-Schema Draft XXX. Is there a standard way to do this?
One thought is to find a download the schema draft itself like draft 4 (http://json-schema.org/draft-04/schema#), and then pass that and S into validate
but I'm wondering if there is a better way to check "this schema is a valid jsonschema".
Upvotes: 2
Views: 2664
Reputation: 3429
The API to validate a schema itself is SomeValidator.check_schema.
Please let me know (by filing an issue) if there's anything in the documentation that would have helped you find it easier!
Upvotes: 1
Reputation: 8428
That's precisely how schemas are validated! Download the meta-schema (declared in the $schema
keyword) and validate the schema against the meta-schema. It's designed to do this.
Upvotes: 3