Override DropWizard ConstraintViolation message

前端 未结 3 382
终归单人心
终归单人心 2020-12-11 05:35

So I want to change the validation messages used to validate a model through a DropWizard resource.

I\'m using java bean validation annotations. For example here is

3条回答
  •  天涯浪人
    2020-12-11 06:25

    @ValidationMethod should be useful here. isn't it?

    http://www.dropwizard.io/0.9.0/docs/manual/validation.html

    @ValidationMethod(message="Password cannot be empty")
    @JsonIgnore
    public boolean isPasswordProvided() {
        return false if password not provided;
    }
    

提交回复
热议问题