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
I think there's an unclarity with unevaluated properties in combination with subschemas, although I must admit that the json schema spec is not particularly clear on some of the details around unevaluatedProperties. My understanding is the following:
The set of unevaluatedProperties for a schema is the set of all properties in the current schema AND any referenced subschema's (through $ref or as separate schema's in e.g. allOf/anyOf) which have not passed validation.
As per general spec, evaluated properties are collected by annotations: "As with all annotations, if at any point validation of a subschema fails, all annotations are dropped, and only the validation failure is propagated up to the parent schema". I take this to mean that failing subschemas do no bubble up their evaluated properties.
Because unevaluated properties are dependent on (possibly dynamic) subschema evaluation, they need to be evaluated last.
Produces three validation errors with the latest version (1.3.2) :
[$.group: property 'notallowed' is not defined in the schema and the schema does not allow additional properties, $: property 'childprop' must not be unevaluated, $: property 'group' must not be unevaluated]
The first validation error is correct, there is an extra property which should not be there. The next two are incorrect (I think): group should've passed validation in the first allOf schema, even though it hasn't been successfully evaluated in the second allOf schema, due to the extra property. childProp should have passed validation in the top level schema.
Looking back, earlier version (e.g. I verified with 1.1.0) do not produce the childProp validation error.
The text was updated successfully, but these errors were encountered:
I think there's an unclarity with unevaluated properties in combination with subschemas, although I must admit that the json schema spec is not particularly clear on some of the details around
unevaluatedProperties
. My understanding is the following:$ref
or as separate schema's in e.g.allOf
/anyOf
) which have not passed validation.Here's a minimal sample that illustrates my case:
This schema has a two subschemas in the
allOf
, one inline one via a$ref
. Running a validation with the following inputProduces three validation errors with the latest version (1.3.2) :
The first validation error is correct, there is an extra property which should not be there. The next two are incorrect (I think):
group
should've passed validation in the firstallOf
schema, even though it hasn't been successfully evaluated in the secondallOf
schema, due to the extra property.childProp
should have passed validation in the top level schema.Looking back, earlier version (e.g. I verified with 1.1.0) do not produce the
childProp
validation error.The text was updated successfully, but these errors were encountered: