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

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

Add tests for enum validation with arrays of boolean values #712

Closed otto-ifak closed 6 months ago

otto-ifak commented 6 months ago

For the const keyword, there are tests like

https://github.com/json-schema-org/JSON-Schema-Test-Suite/blob/589a08581ac1528df9a5422fba56b33cef2497a0/tests/draft2020-12/const.json#L147

This PR adds corresponding tests for enum (for all drafts except draft3).

gregsdennis commented 6 months ago

I'm not sure that these tests are adding anything that this test doesn't already cover.

I suspect that the root of the problem in the linked PR is a zero/false equivalency language issue.

otto-ifak commented 6 months ago

Yes, the linked PR is about Python. However, as far as I understood, there are many tests related to language specific problems in the test suite like JavaScript properties and so on.

I also think, that the new tests indeed cover more than the empty array [] does. There are actually many of these tests for the const keyword already: https://github.com/json-schema-org/JSON-Schema-Test-Suite/blob/589a08581ac1528df9a5422fba56b33cef2497a0/tests/draft2020-12/const.json#L147 I basically just copied these to enum.

Julian commented 6 months ago

Thanks! These look good.

(Greg I assume the thumbs up is understanding how these fit in now -- so merging)