Skip to content

Missing contains in validation vocabulary? #766

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

Closed
fmvilas opened this issue Jul 22, 2019 · 5 comments
Closed

Missing contains in validation vocabulary? #766

fmvilas opened this issue Jul 22, 2019 · 5 comments

Comments

@fmvilas
Copy link

fmvilas commented Jul 22, 2019

Hi! I was reading the work-in-progress validation vocabulary and realized that contains is missing here. Hope it helps.

@handrews
Copy link
Contributor

@fmvilas it's now in the Core spec as part of the applicator vocabulary, since it takes a schema rather than a literal value.

This will probably need a FAQ entry as it's one that feels like an assertion but it's not: conceptually, the keyword applies the schema to every element of the array, and ORs their validation results to produce its validation result. Any keyword that is the result of apply boolean logic to the results of subschema applications is considered an applicator.

@handrews handrews reopened this Jul 22, 2019
@handrews
Copy link
Contributor

hmm... I'm just realizing we may have left something out about what that implies for annotation collection. I'll check tomorrow but re-opening this to remind me.

@awwright
Copy link
Member

That does seem like kind of an arbitrary way of categorizing it, though: "additionalItems" is mostly the same thing as "contains", except in how it propagates validation results. And if it doesn't produce annotation results, can it really be called an applicator?

@handrews
Copy link
Contributor

@awwright it does produce annotation results. That's what I need to go make sure is clear throughout (not just for contains but for all applicators). But I'd just gotten home from a party last night and didn't feel like digging into it.

I'm not sure how this is arbitrary, though, that has always been the definition of an applicator. In particular, it is exactly the reason why dependencies was split into dependentRequired (an assertion) and dependentSchema (an applicator). This has been well-explored and thoroughly discussed in the past year.

@handrews
Copy link
Contributor

Filed #768 for the clarification regarding annotations, so closing this again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants