Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support anyOf, allOf, oneOf, and not, in applyDefaults #52

Open
andy-miracl opened this issue Apr 8, 2018 · 0 comments
Open

support anyOf, allOf, oneOf, and not, in applyDefaults #52

andy-miracl opened this issue Apr 8, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@andy-miracl
Copy link
Contributor

This is subtle, e.g. with anyOf it is possible that the data matches several subschemas each with different default values. Do we apply (a) the first default, (b) the defaults in turn (ordering of map is not necessarily the same as the original schema data file), (c) the first default providing there are no other schemas providing defaults, (d) no defaults (unless there is a single matching subschema).

Similar issue for allOf, do we apply the defaults of each subschema in turn, overriding where necessary?

For oneOf, we must check that the data matches a unique subschema, if it matches more than one then we cannot reliably determine which default (from which subschema) to apply.

not is easy, since the data must never match any of the subschemas we know never to apply any of these defaults.

e.g.
https://spacetelescope.github.io/understanding-json-schema/reference/combining.html

@andy-miracl andy-miracl added the enhancement New feature or request label Apr 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant