json-schema-spec
json-schema-spec copied to clipboard
Reverse "contains" <-> "minContains"/"maxContains" dependency
Fixes #1311.
I think this wording works, but do we want to have minContains
& maxContains
produce an annotation that is consumed by contains
? I understand the "missing keywords can't produce annotations" thing, but that's covered by the current language of assuming a min of 1. Having this annotative communication maintains consistency with how other keywords work.
@gregsdennis this wording was intended to specify the behavior in terms of annotations, and then note an alternative (which we do for some other keywords as well). What are you looking for that isn't there? Do you want more explicit discussion of the consumption of annotations in the description of "contains"?
I was thinking that minContains
and maxContains
would actively produce an annotation that would be consumed by contains
. This follows the model that we have established with additional*
and unevaluated*
.
Currently the wording you have for min/max doesn't say anything about annotations. I think this needs to be added.
Essentially, the dependency is on the annotation rather than on the other keyword directly.
@gregsdennis
Currently the wording you have for min/max doesn't say anything about annotations. I think this needs to be added.
Lines 2530 and 2544 say:
The value of this keyword is used as its annotation result.
Okay, yeah.... I missed that.
@gregsdennis no worries, the mentions are very brief! It actually took me a moment to find them again.
The force-push just now was to rebase and (more importantly) credit @karenetheridge for first coming up with the idea in the commit log.