File tree Expand file tree Collapse file tree 3 files changed +28
-4
lines changed
main/java/org/everit/json/schema
java/org/everit/json/schema
resources/org/everit/jsonvalidator/tostring Expand file tree Collapse file tree 3 files changed +28
-4
lines changed Original file line number Diff line number Diff line change @@ -481,10 +481,15 @@ void describePropertiesTo(JSONPrinter writer) {
481
481
if (!propertyDependencies .isEmpty ()) {
482
482
describePropertyDependenciesTo (writer );
483
483
}
484
+ if (!schemaDependencies .isEmpty ()) {
485
+ writer .key ("dependencies" );
486
+ writer .printSchemaMap (schemaDependencies );
487
+ }
484
488
if (!patternProperties .isEmpty ()) {
485
489
writer .key ("patternProperties" );
486
490
writer .printSchemaMap (patternProperties );
487
491
}
492
+ writer .ifFalse ("additionalProperties" , additionalProperties );
488
493
}
489
494
490
495
private void describePropertyDependenciesTo (JSONPrinter writer ) {
Original file line number Diff line number Diff line change @@ -298,13 +298,18 @@ public void toStringNoExplicitType() {
298
298
assertTrue (ObjectComparator .deepEquals (rawSchemaJson , new JSONObject (actual )));
299
299
}
300
300
301
- @ Test @ Ignore
301
+ @ Test
302
302
public void toStringNoAdditionalProperties () {
303
-
303
+ JSONObject rawSchemaJson = loader .readObj ("tostring/objectschema.json" );
304
+ rawSchemaJson .put ("additionalProperties" , false );
305
+ String actual = SchemaLoader .load (rawSchemaJson ).toString ();
306
+ assertTrue (ObjectComparator .deepEquals (rawSchemaJson , new JSONObject (actual )));
304
307
}
305
308
306
- @ Test @ Ignore
309
+ @ Test
307
310
public void toStringSchemaDependencies () {
308
-
311
+ JSONObject rawSchemaJson = loader .readObj ("tostring/objectschema-schemadep.json" );
312
+ String actual = SchemaLoader .load (rawSchemaJson ).toString ();
313
+ assertTrue (ObjectComparator .deepEquals (rawSchemaJson , new JSONObject (actual )));
309
314
}
310
315
}
Original file line number Diff line number Diff line change
1
+ {
2
+ "dependencies" : {
3
+ "prop1" : {
4
+ "properties" : {
5
+ "prop2" : {
6
+ "type" : " number"
7
+ },
8
+ "prop3" : {
9
+ "type" : " boolean"
10
+ }
11
+ }
12
+ }
13
+ }
14
+ }
You can’t perform that action at this time.
0 commit comments