File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
java/org/everit/json/schema/loader
resources/org/everit/jsonvalidator Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -687,12 +687,21 @@ public void unknownMetaSchemaException() {
687
687
}
688
688
689
689
@ Test
690
- public void sythetizedAllOf () {
690
+ public void syntheticAllOf () {
691
691
String actual = SchemaLoader .load (get ("boolAndNot" )).toString ();
692
692
assertTrue (ObjectComparator .deepEquals (
693
693
get ("boolAndNot" ),
694
694
new JSONObject (actual )
695
695
));
696
+ }
696
697
698
+ @ Test
699
+ public void commonPropsGoIntoWrappingAllOf () {
700
+ CombinedSchema actual = (CombinedSchema ) SchemaLoader .load (get ("syntheticAllOfWithCommonProps" ));
701
+ assertEquals (CombinedSchema .ALL_CRITERION , actual .getCriterion ());
702
+ assertEquals ("http://id" , actual .getId ());
703
+ assertEquals ("my title" , actual .getTitle ());
704
+ assertEquals ("my description" , actual .getDescription ());
705
+ assertNull (actual .getSubschemas ().iterator ().next ().getId ());
697
706
}
698
707
}
Original file line number Diff line number Diff line change 646
646
"boolAndNot" : {
647
647
"type" : " boolean" ,
648
648
"not" : false
649
+ },
650
+ "syntheticAllOfWithCommonProps" : {
651
+ "type" : " integer" ,
652
+ "enum" : [
653
+ 1 ,
654
+ 2 ,
655
+ 3
656
+ ],
657
+ "id" : " http://id" ,
658
+ "title" : " my title" ,
659
+ "description" : " my description"
649
660
}
650
661
}
You can’t perform that action at this time.
0 commit comments