diff --git a/server/implementation/src/main/java/io/smallrye/graphql/validation/BeanValidationError.java b/server/implementation/src/main/java/io/smallrye/graphql/validation/BeanValidationError.java index 54c61636f..1c04a8c92 100644 --- a/server/implementation/src/main/java/io/smallrye/graphql/validation/BeanValidationError.java +++ b/server/implementation/src/main/java/io/smallrye/graphql/validation/BeanValidationError.java @@ -62,11 +62,13 @@ public Map getExtensions() { } private Map 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 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 items(Path.Node node) {