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
Expectation: validation error showing me that $.components.second.meta element is invalid (should be number or string instead of object).
Current situation:
System.NullReferenceException: Object reference not set to an instance of an object.
at Newtonsoft.Json.Schema.Infrastructure.Validation.SchemaScope.GetValidationErrors()
at Newtonsoft.Json.Schema.Infrastructure.Validation.ObjectScope.EvaluateTokenCore(JsonToken token, Object value, Int32 depth)
at Newtonsoft.Json.Schema.Infrastructure.Validation.Validator.ValidateCurrentToken(JsonToken token, Object value, Int32 depth)
at Newtonsoft.Json.Schema.JSchemaValidatingReader.ValidateCurrentToken()
at Newtonsoft.Json.Schema.SchemaExtensions.Validate(JToken source, JSchema schema, SchemaValidationEventHandler validationEventHandler)
at Newtonsoft.Json.Schema.SchemaExtensions.IsValid(JToken source, JSchema schema, IList`1& errors)
ajv command line shows correct JSON data error:
>ajv -s schema.json -d data.json --spec=draft2020
strict mode: use allowUnionTypes to allow union type keyword at "configuration-entry#/allOf/0/then/allOf/0/properties/components/additionalProperties/allOf/0/then/unevaluatedProperties" (strictTypes)
strict mode: use allowUnionTypes to allow union type keyword at "configuration-entry#/allOf/0/then/allOf/0/properties/components/additionalProperties/allOf/1/then/unevaluatedProperties" (strictTypes)
data.json invalid
[
{
instancePath: '/components/second/meta',
schemaPath: '#/allOf/0/then/allOf/0/properties/components/additionalProperties/allOf/1/then/unevaluatedProperties/type',
keyword: 'type',
params: { type: [Array] },
message: 'must be string,number'
}
]
This is my intentionally complicated example JSON schema:
And my example wrong simple JSON file:
Expectation: validation error showing me that
$.components.second.meta
element is invalid (should be number or string instead of object).Current situation:
ajv command line shows correct JSON data error:
library version:
<PackageReference Include="Newtonsoft.Json.Schema" Version="3.0.15" />
The text was updated successfully, but these errors were encountered: