Closed as not planned
Description
In the ExceptionHandler
for MethodArgumentNotValidExceptions
a way for getting the serialized names of the violated fields is missing. Using MethodArgumentNotValidException.getBindingResult().getAllErrors()
... FieldError.getField()
the POJO's name is returned which is not acceptable for the response body in case of different serialized names (Example: photoUrls
vs. photo-urls
).
Code:
@JsonProperty("photo-urls")
private List<URL> photoUrls;
In this case photoUrls
is returned which is the wrong key for the client's request.