File tree 4 files changed +56
-3
lines changed
java/org/openapitools/openapidiff/core
4 files changed +56
-3
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,6 @@ public class AllOfOneOfDiffTest {
9
9
@ Test
10
10
void allOfReferringToOneOfSchemasAreSupported () {
11
11
ChangedOpenApi diff = OpenApiCompare .fromLocations ("issue-317_1.json" , "issue-317_2.json" );
12
- assertThat (diff .isCoreChanged ().isUnchanged ());
12
+ assertThat (diff .isCoreChanged ().isUnchanged ()). isTrue () ;
13
13
}
14
14
}
Original file line number Diff line number Diff line change @@ -41,8 +41,15 @@ public void schemaPropertyDefaultChanged() {
41
41
public void schemaPropertyTypeChanged () {
42
42
ChangedOpenApi changedOpenApi =
43
43
OpenApiCompare .fromLocations (
44
- "schemaDiff/schema-props-defaults-handling-1.yaml" ,
45
- "schemaDiff/schema-props-defaults-handling-2.yaml" );
44
+ "schemaDiff/schema-props-type-handling-1.yaml" ,
45
+ "schemaDiff/schema-props-type-handling-2.yaml" );
46
+
47
+ assertEquals (1 , changedOpenApi .getChangedOperations ().size ());
48
+ assertEquals (1 , changedOpenApi .getChangedSchemas ().size ());
49
+ ChangedSchema changedSchema = changedOpenApi .getChangedSchemas ().get (0 );
50
+ assertEquals (1 , changedSchema .getChangedProperties ().size ());
51
+ assertTrue (changedSchema .getChangedProperties ().containsKey ("field1" ));
52
+ assertTrue (changedSchema .getChangedProperties ().get ("field1" ).isChangedType ());
46
53
}
47
54
48
55
@ Test // issue #485
Original file line number Diff line number Diff line change
1
+ openapi : 3.0.0
2
+ info :
3
+ title : Schema Type Handling Test - Before
4
+ version : 1.0.0
5
+ paths :
6
+ /test :
7
+ post :
8
+ requestBody :
9
+ content :
10
+ application/json :
11
+ schema :
12
+ $ref : ' #/components/schemas/TestSchema'
13
+ responses :
14
+ ' 200 ' :
15
+ description : OK
16
+ components :
17
+ schemas :
18
+ TestSchema :
19
+ type : object
20
+ properties :
21
+ field1 :
22
+ type : string
23
+ description : A field that will change type
Original file line number Diff line number Diff line change
1
+ openapi : 3.0.0
2
+ info :
3
+ title : Schema Type Handling Test - After
4
+ version : 1.0.0
5
+ paths :
6
+ /test :
7
+ post :
8
+ requestBody :
9
+ content :
10
+ application/json :
11
+ schema :
12
+ $ref : ' #/components/schemas/TestSchema'
13
+ responses :
14
+ ' 200 ' :
15
+ description : OK
16
+ components :
17
+ schemas :
18
+ TestSchema :
19
+ type : object
20
+ properties :
21
+ field1 :
22
+ type : integer # Changed from string to integer
23
+ description : A field that has changed type
You can’t perform that action at this time.
0 commit comments