4

In the following JAX-RS endpoint:

public Response myEndpoint(@Context HttpServletRequest httpRequest,
                                         @Valid
                                         @NotNull
                                         @MyBodyPojoIsValid
                                         MyBodyPojo body) {
}

Is it possible to specify that @NotNull will run before my custom validator?

user3913439
  • 396
  • 1
  • 10

1 Answers1

1

The order of validations can be controlled by Validation Groups and @GroupSequence. Here's an article on the subject to get you started.

MartinBG
  • 1,500
  • 13
  • 22