Add tests for 'unevaluatedX' on invalid types#550
Add tests for 'unevaluatedX' on invalid types#550Julian merged 2 commits intojson-schema-org:masterfrom
Conversation
|
The spec isn't as clear on these as it normally is it seems :/ but what part makes you say these are invalid? They seem like they should all be valid to me, and that like most other properties |
I hadn't really given it much thought. I was mostly dealing with the Python library which was raising an exception on unexpected input, regardless of the validity against the schema. I'll update the tests to mark them as expected to pass instead, because I agree with the relevance argument |
|
It looks like we (the spec) no longer has specific sentences in each validator saying "the properties validator MUST consider valid any instance which is not an object" (or never did? Maybe I'm misremembering?). Instead it says once, in 7.6.1:
So yeah it would seem that indeed these are all valid (as they are for other properties). I may be missing it but it seems like it could be slightly easier to know when and how to apply 7.6.1 to each validator if the intended type was called out more explicitly. As-is it seems there's theoretically room for argument as to whether that section is intended for any given specific validator. CC @Relequestual to see if he has thoughts, though if I'm honest I only skimmed the spec and could be missing something. Regardless, for the purposes of this suite, this is good now, thanks. |
Also make them match existing ones slightly more.
|
These tests should be added to draft2019-09 and draft-next as well. |
|
That was done (in the linked commit) :) |
Add tests for
unevaluatedItemsandunevaluatedPropertieson non-applicable types (eg scalars)