Validate a schema against one draft
lalexf opened this issue · 1 comments
Hi,
I was checking the documentation to validate a schema against a specific draft.
The documentation says;
[...] it may be important to ensure that the schema that's created is valid against one of the drafts. To ensure that this is the case, call the ValidateSchema() method. This will analyze all of the keywords and report on whether they are all compatible.
But I could not find a method ValidateSchema() or some thing equivalent.
Am I missing something?
How do I validate a schema? I can write some thing like
var serializer = new JsonSerializer();
var schemaText = File.ReadAllText(schemaPath);
var schemaJson = JsonValue.Parse(schemaText);
var schema = serializer.Deserialize<JsonSchema04>(schemaJson);
, but this does not seem to validate the schema.
It just throws if $schema
does not match, but does not do more checks.
You'll need to get the prerelease version 10. Schema has been reworked, and those docs are for that. At the top of the page, you'll find a link to the docs for the v9 and earlier implementation.