Open TenOs opened 3 years ago
Diff:
--- core/src/test/resources/issue-212-1.yaml 2021-02-28 17:52:14.000000000 +0100
+++ core/src/test/resources/issue-212-2.yaml 2021-02-28 17:52:34.000000000 +0100
@@ -23,15 +23,11 @@
title: ResponseA
required:
- attr_a_1
- - attr_a_2
type: object
properties:
attr_a_1:
title: Attr A 1
type: string
- attr_a_2:
- title: Attr A 2
- type: string
ResponseB:
title: ResponseB
required:
Found that the error is within the SchemaDiff
class in the method Schema<?> resolveComposedSchema(Components, Schema<?>)
which only considers ((ComposedSchema) schema).getAllOf()
but not ((ComposedSchema) schema).getAnyOf()
Can this be closed now after that that PR was merged?
So I've been tested openapi-diff to see if we can use it in our CI/CD pipeline to prevent any breaking changes from happening. After running a few tests I've noticed that it doesn't seem to support
anyOf
correctly.See the two openapi files attached. Basically the endpoint returns a response which either
ResponseA
orResponseB
. New file removes a required property fromResponseA
and openapi-diff doesn't catch the breaking change. old.yamlnew.yaml
Result
This is a very simple test scenario, but I've tested the same one with a change like this in:
for all of them it wasn't detecting any breaking changes....
I've tested these using docker
openapitools/openapi-diff:latest
.