File tree 3 files changed +71
-0
lines changed
java/org/openapitools/openapidiff/core
3 files changed +71
-0
lines changed Original file line number Diff line number Diff line change 1
1
package org .openapitools .openapidiff .core ;
2
2
3
+ import static org .assertj .core .api .Assertions .assertThat ;
3
4
import static org .openapitools .openapidiff .core .TestUtils .assertOpenApiChangedEndpoints ;
4
5
5
6
import org .junit .jupiter .api .Test ;
7
+ import org .openapitools .openapidiff .core .model .ChangedOpenApi ;
6
8
7
9
public class RequestDiffTest {
8
10
private final String OPENAPI_DOC1 = "request_diff_1.yaml" ;
@@ -12,4 +14,13 @@ public class RequestDiffTest {
12
14
public void testDiffDifferent () {
13
15
assertOpenApiChangedEndpoints (OPENAPI_DOC1 , OPENAPI_DOC2 );
14
16
}
17
+
18
+ @ Test
19
+ public void testSameTypeResponseSchemaDIff () {
20
+ ChangedOpenApi changedOpenApi =
21
+ OpenApiCompare .fromLocations (
22
+ "response_schema_simple_object_type.yaml" ,
23
+ "response_schema_simple_object_type_with_alloff.yaml" );
24
+ assertThat (changedOpenApi .isCompatible ()).isTrue ();
25
+ }
15
26
}
Original file line number Diff line number Diff line change
1
+ openapi : " 3.0.0"
2
+ info :
3
+ title : Sample API
4
+ description : API description in Markdown.
5
+ version : 1.0.0
6
+ servers : []
7
+ paths :
8
+ /test :
9
+ get :
10
+ summary : Your GET endpoint
11
+ tags : []
12
+ responses :
13
+ ' 200 ' :
14
+ description : OK
15
+ content :
16
+ application/json :
17
+ schema :
18
+ $ref : ' #/components/schemas/working'
19
+ components :
20
+ schemas :
21
+ working :
22
+ type : object
23
+ properties :
24
+ foo :
25
+ type : string
26
+ bar :
27
+ type : integer
Original file line number Diff line number Diff line change
1
+ openapi : 3.0.0
2
+ info :
3
+ title : Sample API
4
+ description : API description in Markdown.
5
+ version : 1.1.0
6
+ servers : []
7
+ paths :
8
+ /test :
9
+ get :
10
+ summary : Your GET endpoint
11
+ tags : []
12
+ responses :
13
+ ' 200 ' :
14
+ description : OK
15
+ content :
16
+ application/json :
17
+ schema :
18
+ $ref : ' #/components/schemas/working'
19
+ operationId : get-test
20
+ components :
21
+ schemas :
22
+ working :
23
+ allOf :
24
+ - type : object
25
+ properties :
26
+ foo :
27
+ type : string
28
+ - $ref : ' #/components/schemas/bar'
29
+ bar :
30
+ type : object
31
+ properties :
32
+ bar :
33
+ type : integer
You can’t perform that action at this time.
0 commit comments