Context
validate_schema_change() compares only top-level properties and required. It does not resolve $ref or walk allOf sub-schemas. This is documented in the docstring.
Problem
If someone passes a composed schema (with allOf + $ref to the base entity schema), changes in referenced sub-schemas won't be detected. This is fine for the current add_field use case (which operates on app-level schemas only), but could surprise callers using it for broader schema comparisons in the future.
Options
- Document only — add a note in CLAUDE.md or a code comment making the limitation more visible
- Extend — optionally resolve
$ref via _REF_MAP and flatten allOf before comparing, gated by a parameter like resolve_refs=False
Current recommendation: option 1, unless a use case arises that requires full resolution.
Context
validate_schema_change()compares only top-levelpropertiesandrequired. It does not resolve$refor walkallOfsub-schemas. This is documented in the docstring.Problem
If someone passes a composed schema (with
allOf+$refto the base entity schema), changes in referenced sub-schemas won't be detected. This is fine for the currentadd_fielduse case (which operates on app-level schemas only), but could surprise callers using it for broader schema comparisons in the future.Options
$refvia_REF_MAPand flattenallOfbefore comparing, gated by a parameter likeresolve_refs=FalseCurrent recommendation: option 1, unless a use case arises that requires full resolution.