Validate Schema against the JSON schema spec

43 views
Skip to first unread message

Charles-Élie Simon

unread,
Mar 6, 2017, 8:28:37 AM3/6/17
to Ruby JSON Schema Library
Hello,

I would like to know if the library offers the possibility to simply validate a JSON Schema against the JSON schema spec, and if yes, how.
I know of the :validate_schema option, but it only allows to validate a schema before validating a JSON instance against the schema. I would like to be able to just validate the schema against the spec.

Thank you for your answers !

Iain Beeston

unread,
Mar 6, 2017, 9:17:20 AM3/6/17
to Ruby JSON Schema Library
You can do this by specifying the official meta-schema as your schema, for example:

JSON::Validator.validate("http://json-schema.org/draft-04/schema#", my_schema)

That's essentially what the gem does when you use the validate schema option.
Message has been deleted

Charles-Élie Simon

unread,
Mar 6, 2017, 1:18:18 PM3/6/17
to Ruby JSON Schema Library
Thank you so much for your quick answer ! This was very helpful.
Reply all
Reply to author
Forward
0 new messages