Open karenetheridge opened 4 years ago
~You need to move the unevalated*
out of the allOf
to make that work right.~
Oh, I see. You're saying these are not the same, which is correct. But if you move the unevaluated*
out of the allOf
, then they become semantically the same.
I don't follow.. if unevaluatedProperties
is the consumer of the annotations, it doesn't matter if the keywords are siblings or underneath an allOf
. In both cases, the other keywords run first and unevaluatedProperties
runs later.
If unevaluatedProperties
is the producer of the annotations for some other keyword to consume, then that would be different, but the only keyword that consumes the unevaluatedProperties
annotation is unevaluatedProperties
itself, so I doubt that's what was intended here.
Hey! I am writing an example below, tell me if this matches what is expected:
{
"properties":{
"foo": { "const": 11}
},
"allOf":[
{
"properties":{
"baz": {"type": "string"}
},
"unevaluatedProperties": false
}
]
}
--- this produces validation false
{
"properties":{
"foo": { "const": 11}
},
"$ref": "#/$defs/bar",
"unevaluatedProperties": false,
"$defs":{
"bar":{
"properties":{
"baz": {"type": "string"}
}
}
}
}
--- and this produces true result.
for the instance:
{"foo":11, "baz": "hello"}
@gregsdennis @jdesrosiers @Julian
see https://json-schema.slack.com/archives/CT7FF623C/p1603727881177900?thread_ts=1603504778.173300&cid=CT7FF623C
Basically, we need a test to show that changing this:
to this:
...does not always yield the same result, sibling keywords in a subschema can see annotations produced by earlier-evaluating siblings, but subchemas under allOf siblings cannot see each other's annotation results.
Therefore, this is not a reliable mechanism of transcluding/bundling referenced subschemas into the same schema.
cc @Relequestual