json-schema-org / JSON-Schema-Test-Suite

A language agnostic test suite for the JSON Schema specifications
MIT License
625 stars 209 forks source link

Missing test for `unevaluatedProperties` and `$dynamicRef` #691

Closed Relequestual closed 1 year ago

Relequestual commented 1 year ago

After some discussions with @Julian having poked about at some implementations and how they handle unevaluatedProperties, I found we have no test for unevaluatedProperties and $dynamicRef.

Why would we need such a test? Well, consdier if unevaluatedProperties was implemented not using the annotation system, and in stead, the whole determination of validitiy was done by, in silo, re-doing all the other same scheam object keyword's validation again? This is the case in more than one implementation. (We aren't here to debate this approach, there's another issue for that elsewhere.)

As such, we need to test that unevaluatedProperties takes note of the results of every other keyword which it should do, including applicators.

We do this for $ref, but not $dynamicRef:

https://github.com/json-schema-org/JSON-Schema-Test-Suite/blob/a9a1e2e347c3b7e840a1a2052cc7182072b23ac0/tests/draft2020-12/unevaluatedProperties.json#L681

We should also just double check that these tests include the use of all applicators individually.

jdesrosiers commented 1 year ago

I thought I added tests for all of those things, but it seems I missed that one.

This test has unevaluatedProperties with a dynamic reference. It's not apparent because the dynamic reference is in a remote. https://github.com/json-schema-org/JSON-Schema-Test-Suite/blob/a9a1e2e347c3b7e840a1a2052cc7182072b23ac0/tests/draft2020-12/dynamicRef.json#L534-L564

There doesn't appear to be a test that involves unevaluatedItems and dynamic references.