I looked at the ConstraintViolationMapper that is used in our project which 
transforms propertyPaths to short field names. It looks like I found the 
root cause.

On Friday, 7 July 2017 08:33:20 UTC+2, [email protected] wrote:
>
> I found out that the right term is property path. I additionally found 
> another thread mentioning this:
> https://groups.google.com/forum/#!topic/dropwizard-user/2EsIjYgIYqQ
>
> On Friday, 7 July 2017 07:57:27 UTC+2, [email protected] wrote:
>>
>> Hi,
>>
>> I have been steadily upgrading Dropwizard from 0.8 to 1.0. After 0.9 to 
>> 1.0 upgrade I noticed that error responses include qualified attribute 
>> names instead of short field names. Here's an example response body:
>>
>> {
>>     "errors": [
>>         {
>>             "attribute": "arg_0_._users_._password",
>>             "error": "invalid"
>>         }
>>     ]
>> }
>>
>> Previously, the same code returned a response with the following content:
>> {
>>     "errors": [
>>         {
>>             "attribute": "password",
>>             "error": "invalid"
>>         }
>>     ]
>> }
>>
>> The resource is defined as follows:
>>     @POST
>>     public Response createUser(
>>             @Valid final CreateUserWrapper requestBody) {
>>
>>         ...
>>     }
>>
>> And the bean classes are defined as:
>> public class CreateUserWrapper {
>>     
>>     @NotNull
>>     @Valid
>>     @JsonProperty
>>     private CreateUserModel users;
>>
>>     ...setter/getter
>> }
>>
>> public class CreateUserModel {
>>
>>     @Email
>>     @NotBlank
>>     @JsonProperty
>>     private String email;
>>
>>     @JsonProperty
>>     @NotBlank
>>     @ValidPassword
>>     private String password;
>>         
>>     ...setters/getters
>> }
>>
>>
>> I suspect the issue may be caused by upgrade to a newer version of 
>> hibernate-validator (currently using 5.3.4 Final). I suspect this can be 
>> configured or overriden somewhere but I couldn't come up with the right 
>> terms to find anything relevant in either Dropwizard or Hibernate docs. The 
>> upgrade guides also don't mention anything related.
>>
>> Any ideas which direction I should be looking in?
>>
>> Thank you.
>>
>> /Sergey
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"dropwizard-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to