Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use
anyOf
when @allow-other = 'yes'
in JSON Schema
When there is a type and an enumeration in JSON Schema, using `allOf` means that a value must satisfy _both_ types. This is appropriate when `@allow-other = 'no'` because it effectively limits the permitted values to the enumeration; however, when `@allow-other = 'yes'`, that limitation means that you are not able to use 'locally defined' values. In this case, `anyOf` is preferable, this allows values in the enumeration and otherwise any value that matches the schema for the type. A check is added explicitly for `@allow-other = 'yes'` as `@allow-other = 'no'` is the default and matches the existing behavior.
- Loading branch information