You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to validate a JSON schema itself using the JSON Schema schema or meta-schema e.g. from https://json-schema.org/draft/2020-12/schema, an error occurs when loading this schema into NJsonSchema due to an issue with the const keyword in a referenced schema.
Repro
varschemaJson=@"{ ""$id"": ""https://example.com/person.schema.json"", ""$schema"": ""https://json-schema.org/draft/2020-12/schema"", ""title"": ""Person"", ""type"": ""object"", ""properties"": { ""firstName"": { ""type"": ""string"", ""description"": ""The person's first name."" }, ""lastName"": { ""type"": ""string"", ""description"": ""The person's last name."" }, ""age"": { ""description"": ""Age in years which must be equal to or greater than zero."", ""type"": ""integer"", ""minimum"": 0 } }}";// Load this schemavarschema=await JsonSchema.FromJsonAsync(schemaJson);// Load the JSON Schema schema using the schema version e.g. https://json-schema.org/draft/2020-12/schemavarmetaSchema=await JsonSchema.FromUrlAsync(schema.SchemaVersion);// Validate the JSON schema using the meta schemavarvalidator=new JsonSchemaValidator();varresult= validator.Validate(schemaJson, metaSchema);
The line JsonSchema.FromUrlAsync(schema.SchemaVersion); results in the following exception:
The problem seems to arise from the meta/validation referenced schema which, when NJsonSchema resolves and attempts to load it. blows up when it encounters const: true
The text was updated successfully, but these errors were encountered:
When attempting to validate a JSON schema itself using the JSON Schema schema or meta-schema e.g. from https://json-schema.org/draft/2020-12/schema, an error occurs when loading this schema into NJsonSchema due to an issue with the
const
keyword in a referenced schema.Repro
The line
JsonSchema.FromUrlAsync(schema.SchemaVersion);
results in the following exception:The problem seems to arise from the
meta/validation
referenced schema which, when NJsonSchema resolves and attempts to load it. blows up when it encountersconst: true
The text was updated successfully, but these errors were encountered: