You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
False positive no-required-schema-properties-undefined when required used inside not #3104
The rule flags required entries inside a not subschema as "Required property 'x' is not defined." But required under not is the standard JSON Schema idiom for asserting a property's absence (or mutual exclusion of properties) — there is intentionally nothing to declare in a sibling properties, and the properties may even be declared on the enclosing object schema. The rule's purpose (catching typos where required names an undeclared property) doesn't apply to these assertion-only subschemas.
Root cause: in no-required-schema-properties-undefined, findCompositionRoot walks up only through allOf/anyOf/oneOf parents (isCompositionChild), so any schema reached via not never resolves a composition root and its own (usually empty) properties is the only thing checked.
Actual behavior
#/components/schemas/Contact/not/required/0 Required property 'email' is not defined.
#/components/schemas/Contact/not/required/1 Required property 'phone' is not defined.
Expected behavior
No warnings. Either (a) required occurrences inside a not subschema (at any depth) are exempt, since they are presence/absence assertions rather than shape declarations, or (b) property resolution traverses the not boundary to the enclosing object schema the way it already traverses allOf/anyOf/oneOf.
Activity