Description
The "Keyword Interactions" section of the core spec currently reads as:
Keyword behavior MAY be defined in terms of the annotation results of
subschemas (Section 4.3.3) and/or adjacent keywords. Such keywords
MUST NOT result in a circular dependency. Keywords MAY modify their
behavior based on the presence or absence of another keyword in the
same schema object (Section 4.3).
It seems to me that the meaning of this paragraph is that:
- Keyword behavior can only be recursively defined in terms of:
- The annotation results of subschemas.
- The annotation results of other keywords that share the same parent schema object.
- The presence or absence of another keyword in the same schema object.
This definition seems to have a number of problems, on my reading:
- It leaves unclear whether this section is laying out all a keyword may do, or if it is merely stating what a keyword may not do.
- Keywords may be defined in terms of the validation results of subschemas and adjacent keywords. The current definition makes no references to validation at all.
$ref
and$recursiveRef
are not supported on this definition. The referent of these keywords may not be in the same schema object, but their outcomes are entirely defined in terms of their referents. Furthermore,$recursiveAnchor
affects the behavior of referring schema objects.
As an aside, I don't think the exclusion of circular dependency is required. A circular definition is no definition at all.
I'm happy to open a PR to fix this section! But I would like clarification on the following questions:
- Are we, in "Keyword Interactions", trying to explicitly lay out everything a keyword may do, or are we merely just enumerating what a keyword shouldn't do?
- Is the omission of any reference to validation intentional?
- What does "the same schema object" mean? How does it relate to external references?
Happy to help! But I don't want to make assumptions about the three preceding questions.