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

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

Break out optional tests into requirement-level directories #708

Open gregsdennis opened 10 months ago

gregsdennis commented 10 months ago

This is another attempt at #590: it would be nice to have the optional tests indicate to what degree they are optional.

I've also added readmes to each of the directories so that the intent of the folder is known (both for implementors and for people amending the tests).

I've only done draft/next for now. I'm not sure if we want to apply this to the previous versions.

Refs: https://github.com/json-schema-org/JSON-Schema-Test-Suite/issues/495 https://github.com/json-schema-org/JSON-Schema-Test-Suite/issues/25

Open Questions

bignum & float-overflow

Are these tests in optional because the JSON spec makes a concession for environments that can't handle arbitrary numbers? While JSON Schema doesn't define any restrictions, it also doesn't make any such concessions.

I've put them in undefined/ for now.

References:

format-assertion

The spec isn't explicit on the requirement level for vocabularies as a feature. I'd (@gregsdennis) assume it's a MUST, but that's just an interpretation.

There are requirement levels on $vocabulary and its usage, but nothing requiring that vocabularies be a supported feature in general.

As such, I'm not sure where this should go.

First, all of these tests assume that the format-assertion vocabulary is understood, which is optional. ("An implementation that supports the Format-Assertion vocabulary..." implies that implementations have the option to not support it.)

Secondly, assuming the above, these test become mandatory because "full validation support" is a MUST requirement.

I think this is a MAY overall, but could use confirmation.

Also, we don't have any tests around not understanding the format-assertion vocabulary. I think this is partially due to the fact that we can't handle error scenarios.

References:

gregsdennis commented 5 months ago

Maybe instead of moving tests, we can copy them in the new organization scheme to a new folder so that older test suite runners can still operate.