Skip to content

Commit

Permalink
Fix #2219: bean validation regression for null values
Browse files Browse the repository at this point in the history
  • Loading branch information
dpolysiou authored and jmartisk committed Nov 5, 2024
1 parent 8178196 commit 6f9c9c6
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,13 @@ public Map<String, Object> getExtensions() {
}

private Map<String, Object> getViolationAttributes(ConstraintViolation<?> violation) {
return Map.of(
"message", violation.getMessage(),
"propertyPath", toStream(violation.getPropertyPath()).flatMap(this::items).collect(toList()),
"invalidValue", violation.getInvalidValue(),
"constraint", getConstraintAttributes(violation));
Map<String, Object> attributes = new HashMap<>();
attributes.put("message", violation.getMessage());
attributes.put("propertyPath",
toStream(violation.getPropertyPath()).flatMap(this::items).collect(toList()));
attributes.put("invalidValue", violation.getInvalidValue());
attributes.put("constraint", getConstraintAttributes(violation));
return attributes;
}

private Stream<String> items(Path.Node node) {
Expand Down

0 comments on commit 6f9c9c6

Please sign in to comment.