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 breaking change when direct array type changes to allOf-wrapped array #920
#916 fixed the ClassCastException for allOf-wrapped array → direct type: array. The opposite direction does not throw, but reports a breaking change between two equivalent specs.
Reproduction
Using the fixtures added in #916, with the arguments swapped:
resolveComposedSchema merges allOf members into the parent but leaves the instance as a ComposedSchema, so with the allOf spec on the right, ComposedSchemaDiffResult is selected. Its else branch fires because left is an ArraySchema rather than a ComposedSchema:
That reports a type change even though left.getType() and right.getType() are both array — computeDiffForReal already verified they match before dispatching.
Suggested fix
In ComposedSchemaDiffResult.diff, when left is not a ComposedSchema, fall through to super.diff(...) instead of declaring a type change — the type/format equality check upstream has already passed at that point. The oneOf/discriminator handling stays behind the existing instanceof guard.
More generally, the dispatch being driven solely by right.getClass() makes composed-vs-plain comparisons asymmetric; worth considering whether the result class should be chosen from both sides.
Note
Issue887Test.testDirectArrayToAllOfArrayDoesNotThrow covers this direction but asserts only that no exception is thrown, so it passes against the current wrong output. It should become assertOpenApiAreEquals(DIRECT_ARRAY, ALLOF_ARRAY) once this is fixed.
Activity
fix OpenAPITools#920: no type change when array is wrapped in allOf (O…