For example, here's a Get request:
get: /search?product_category=1&user_name=obama
I want to define a SearchRequest
to accept the query string, so I can use JSR 303 bean validation annotations to validate parameters, like below:
public class SearchRequest {
@NotEmpty(message="product category is empty")
private int productCategory;
@NotEmpty(message="user name is empty")
private int userName;
}
So, is there something like @JsonProperty
in jackson to convert underscore style to camel style?