java - Nested bean validation using Group Sequence -
i have rest services take bean input:
@get @produces(mediatype.application_json + "; charset=utf-8") @path("/{a}/{b}") public response getdetails(@beanparam @valid imputform form) throws applicationexception {
the input form has field takes value headerparam , should check before other field, , achieved using custom annotation defining group sequence:
@headerparam("value") @idcheck(groups = {auth.class}, payload = severitypayload.forbidden.class) private string id;
the inputform class annotated with:
@groupsequence(value = {auth.class, inputform.class)
so far perfect, problems come out when add bean in inputform, should validated in way:
@beanparam @valid private customobject customobject;
in custom object there validation too, like:
@notnull @notempty @pathparam("value") private string innerstring
my problem when both id , innerstring don't respect validation, expect see id validated first following group sequence, validation in nested object evaluated first.
someone has hint?
Comments
Post a Comment