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

Add addtionalItemsContains and unevaluatedItemsContains keywords #14

Open
jdesrosiers opened this issue Feb 28, 2020 · 1 comment
Open

Comments

@jdesrosiers
Copy link
Member

This isn't a serious feature request at this point, but it occurred to me that this was something that JSON Schema is incapable of expressing, so I'm creating an issue to document the deficiency. I've never heard of anyone needing this feature, so it's probably better for someone to write a vocab for if they need it.

These keywords would work exactly like contains, but only apply to "additional items" as determined by additionalItems or unevaluatedItems.

Proposal

  • Add keyword additionalItemsContains that works exactly like contains, but only applies to "additional items" as determined by the additionalItems keyword.
  • Add keyword additionalItemsMaxContains that works exactly like maxContains, but only applies to "additional items" as determined by the additionalItems keyword.
  • Add keyword additionalItemsMinContains that works exactly like minContains, but only applies to "additional items" as determined by the additionalItems keyword.
  • Add keyword unevaluatedItemsContains that works exactly like contains, but only applies to "additional items" as determined by the unevaluatedItems keyword.
  • Add keyword unevaluatedItemsMaxContains that works exactly like maxContains, but only applies to "additional items" as determined by the unevaluatedItems keyword.
  • Add keyword unevaluatedItemsMinContains that works exactly like minContains, but only applies to "additional items" as determined by the unevaluatedItems keyword.

Pros

  • Givens JSON Schema the ability to describe something it can't currently do.

Cons

  • That's a lot of keywords to add for a feature that no one has ever asked for.
@handrews
Copy link
Contributor

That's a lot of keywords to add for a feature that no one has ever asked for.

🤣

I'm going to go ahead and move this over to our vocabularies repo- we're doing that with most new keyword proposals now (although we haven't finished moving the ones that were filed in the past).

@handrews handrews transferred this issue from json-schema-org/json-schema-spec Feb 28, 2020
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

2 participants