File tree Expand file tree Collapse file tree 5 files changed +147
-0
lines changed
java/org/openapitools/openapidiff/core/backcompat Expand file tree Collapse file tree 5 files changed +147
-0
lines changed Original file line number Diff line number Diff line change
1
+ package org .openapitools .openapidiff .core .backcompat ;
2
+
3
+ import static org .openapitools .openapidiff .core .TestUtils .assertOpenApiBackwardIncompatible ;
4
+ import static org .openapitools .openapidiff .core .TestUtils .assertSpecChangedButCompatible ;
5
+ import static org .openapitools .openapidiff .core .TestUtils .assertSpecUnchanged ;
6
+
7
+ import org .junit .jupiter .api .Test ;
8
+
9
+ public class ContentBCTest {
10
+ private final String BASE = "bc_content_base.yaml" ;
11
+
12
+ @ Test
13
+ public void unchanged () {
14
+ assertSpecUnchanged (BASE , BASE );
15
+ }
16
+
17
+ @ Test
18
+ public void changedButCompatible () {
19
+ assertSpecChangedButCompatible (BASE , "bc_content_changed_but_compatible.yaml" );
20
+ }
21
+
22
+ @ Test
23
+ public void requestDecreased () {
24
+ assertOpenApiBackwardIncompatible (BASE , "bc_request_content_decreased.yaml" );
25
+ }
26
+
27
+ @ Test
28
+ public void responseDecreased () {
29
+ assertOpenApiBackwardIncompatible (BASE , "bc_response_content_decreased.yaml" );
30
+ }
31
+ }
Original file line number Diff line number Diff line change
1
+ openapi : 3.0.0
2
+ info :
3
+ description : myDesc
4
+ title : myTitle
5
+ version : 1.0.0
6
+ paths :
7
+ /widgets :
8
+ post :
9
+ operationId : widgetCreate
10
+ requestBody :
11
+ content :
12
+ application/json :
13
+ schema :
14
+ type : integer
15
+ format : int32
16
+ application/text :
17
+ schema :
18
+ type : string
19
+ responses :
20
+ ' 200 ' :
21
+ description : successful operation
22
+ content :
23
+ application/json :
24
+ schema :
25
+ type : integer
26
+ format : int32
27
+ application/text :
28
+ schema :
29
+ type : string
Original file line number Diff line number Diff line change
1
+ openapi : 3.0.0
2
+ info :
3
+ description : myDesc
4
+ title : myTitle
5
+ version : 1.0.0
6
+ paths :
7
+ /widgets :
8
+ post :
9
+ operationId : widgetCreate
10
+ requestBody :
11
+ content :
12
+ application/json :
13
+ schema :
14
+ type : integer
15
+ format : int32
16
+ application/text :
17
+ schema :
18
+ type : string
19
+ application/xml :
20
+ schema :
21
+ type : string
22
+ responses :
23
+ ' 200 ' :
24
+ description : successful operation
25
+ content :
26
+ application/json :
27
+ schema :
28
+ type : integer
29
+ format : int32
30
+ application/text :
31
+ schema :
32
+ type : string
33
+ application/xml :
34
+ schema :
35
+ type : string
Original file line number Diff line number Diff line change
1
+ openapi : 3.0.0
2
+ info :
3
+ description : myDesc
4
+ title : myTitle
5
+ version : 1.0.0
6
+ paths :
7
+ /widgets :
8
+ post :
9
+ operationId : widgetCreate
10
+ requestBody :
11
+ content :
12
+ application/json :
13
+ schema :
14
+ type : integer
15
+ format : int32
16
+ responses :
17
+ ' 200 ' :
18
+ description : successful operation
19
+ content :
20
+ application/json :
21
+ schema :
22
+ type : integer
23
+ format : int32
24
+ application/text :
25
+ schema :
26
+ type : string
Original file line number Diff line number Diff line change
1
+ openapi : 3.0.0
2
+ info :
3
+ description : myDesc
4
+ title : myTitle
5
+ version : 1.0.0
6
+ paths :
7
+ /widgets :
8
+ post :
9
+ operationId : widgetCreate
10
+ requestBody :
11
+ content :
12
+ application/json :
13
+ schema :
14
+ type : integer
15
+ format : int32
16
+ application/text :
17
+ schema :
18
+ type : string
19
+ responses :
20
+ ' 200 ' :
21
+ description : successful operation
22
+ content :
23
+ application/json :
24
+ schema :
25
+ type : integer
26
+ format : int32
You can’t perform that action at this time.
0 commit comments