java - Jackson and Hibernate Validator -
are there online tutorial available utilize hibernate validator jackson validating json? using spring , jackson json parsing. spring, utilize mappingjacksonhttpmessageconverter automatically translate incoming json payload java object.
i add together validator annotations java class. example, if have person class "name" 1 of fields, validate json payload if "name" element appears 1 time. if appears more 1 time in payload, validator kick in reject request.
right observed if there multiple names in payload, jackson ignores , picks lastly one.
the java object not bound xml schema , like.
what best practice validating json?
spring has jsr-303 back upwards built in, see chapter in the reference manual.
if using spring mvc, see here, should able annotate parameters @requestmapping
methods @valid
.
java json jackson hibernate-validator
No comments:
Post a Comment