Open gregsdennis opened 1 year ago
There is mention of this in https://github.com/json-schema-org/json-schema-spec/issues/846#issuecomment-582197653
There are a number of syntactic sugar proposals, and as @jdesrosiers notes maybe making them an additional vocabulary outside of the Core and Validation specification documents would be a good approach. - @handrews
I think there should be a minimumRequired keyword.
@Era-cell we already have min/max properties. Is that different from what you're asking for?
@Era-cell we already have min/max properties. Is that different from what you're asking for?
Yeah its different, like: arrays have minContains so we should have minRequired which will be taking integer values
@Era-cell you're probably going to be interested in https://github.com/json-schema-org/json-schema-spec/issues/1488. I think this covers what you're looking for.
The keyword set defined by the core vocabs can do lots of things, but sometimes those things are difficult or cumbersome to represent.
I'd like to propose a combinatorics vocab that defines keywords that represent combinations of applicators.
For example, if you wanted to require any of a number of properties, you currently have to do
or maybe (though it's not quite the same thing because the above also allows additional properties)
But the vocab could define a single keyword, e.g.
anyOfRequired
that does this much more simplyThis vocab would be full of odds and ends like this.
A lot of keyword requests are about making things like this easier, so maybe we just have an evolving vocab to contain these "refactor" keywords.