✨ Proposal: Not all keywords need to produce a validation result. #1540
Labels
proposal
Initial discussion of a new idea. A project will be created once a proposal document is created.
Milestone
Describe the inspiration for your proposal
The current specifications declare a validation result for every non-core keyword. On keywords for which a validation result doesn't really make sense, it says that validation must always pass or that they must always return a "true" validation result.
Examples are
if
,minContains
, andmaxContains
. For the latter two, it's especially apparent since we've moved them into the Core spec alongsidecontains
. Specifically, the WIP version states that these two keywords "modify the behavior ofcontains
". Then it talks about validation for them.If their purpose is to help
contains
do its job, why should they produce a validation result at all?Describe the proposal
The spec should state whether a keyword should be ignored for validation purposes.
I think instead of each keyword needing to specify, we just have a single statement at the top that says something like
This would need to go in Core.
Describe alternatives you've considered
No alternatives; just the proposal.
Additional context
This would also apply to all of the "pure annotation" keywords, like
title
anddeprecated
.I like the idea of keywords having disjoint roles. It can help move us toward supporting other things people use JSON Schema for, like code/schema/form/docs generation.
The text was updated successfully, but these errors were encountered: