Fix ClassCastException when allOf array changes to type array
Merged
KA
3mo ago+97+97+01234567890123456789-6-6-0123456789
Fixes #887
When a property changes from allOf wrapping an array schema to a direct type: array, the left side stays a ComposedSchema after resolution while the right side is an ArraySchema. Casting both to ArraySchema threw ClassCastException.
Changes:
- copy
itemswhen merging composed schemas inaddSchema - use
Schema#getItems()inArraySchemaDiffResultinstead of casting - add regression test from the issue repro
Summary by cubic
Fixes a crash when diffing array schemas that change from an allOf-wrapped array to a direct type: array. Prevents ClassCastException and ensures the specs compare equal.
- Bug Fixes
- Copy
itemsinaddSchemawhen merging composed schemas. - Use
Schema#getItems()inArraySchemaDiffResultinstead of casting. - Strengthen regression: assert no exception and that both specs are equal.
- Copy