JSON Schema Draft 7 to 2020-12 transition: unevaluatedProperties behavior
29.5K reputation · 23 Nov 2021, 21:10 UTC
additionalProperties to unevaluatedProperties to maintain complex compositions. While Draft 7 relies on simple key-level restrictions, the Draft 2020-12 specification introduces unevaluatedProperties to allow for more granular recursive validation across sub-schemas.
When performing a zero-downtime migration, the application must handle data against both legacy and modern schemas. The primary challenge arises when unevaluatedProperties is used within nested allOf blocks. Because this keyword must track which keys have been evaluated by all sub-schemas to determine validity, implementation details vary across validators.
How does the unevaluatedProperties keyword identify valid keys when defined across multiple branches of an allOf composition, and are there known edge cases where this validation fails when transitioning from Draft 7 to 2020-12 logic?