Skip to content

Commit cf15e1d

Browse files
arkmic35vietj
authored andcommitted
Show property name when unexpected additional property found in JSON
Signed-off-by: Arkadiusz Michalak <[email protected]>
1 parent 826e116 commit cf15e1d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/io/vertx/json/schema/common/PropertiesValidatorFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public Future<Void> validateAsync(ValidatorContext context, final Object in) thr
208208
}
209209
}
210210
} else {
211-
return Future.failedFuture(create("provided object should not contain additional properties", "additionalProperties", in));
211+
return Future.failedFuture(create("Provided object contains unexpected additional property: " + key, "additionalProperties", in));
212212
}
213213
}
214214
}
@@ -248,7 +248,7 @@ public void validateSync(ValidatorContext context, final Object in) throws Valid
248248
additionalPropertiesSchema.validateSync(context.lowerLevelContext(key), obj.get(key));
249249
}
250250
} else {
251-
throw create("provided object should not contain additional properties", "additionalProperties", in);
251+
throw create("Provided object contains unexpected additional property: " + key, "additionalProperties", in);
252252
}
253253
}
254254
}

0 commit comments

Comments
 (0)