Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python; jsonschema, validate that a schema is valid jsonschema

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".

like image 602
Tommy Avatar asked Jan 22 '26 22:01

Tommy


1 Answers

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.

like image 196
gregsdennis Avatar answered Jan 25 '26 12:01

gregsdennis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!