I have an endpoint implementation, that I am passing an object to in the parameter list. I am trying to verify that this object is not null, using the @NotNull annotation. <
Not sure about the @ApiParam (from swagger?), but the following works for me with Jersey 2.22:
@GET
@Path("/hz-test")
public Response proc(
@NotNull @QueryParam("hz") String myvalue) {
I suspect also that you would need to use the @NotNull with one of the other Jersey parameter annotations (e.g. @QueryParam, @HeaderParam, etc.).
BTW, what version of jersey are you using ? (@NotNull is supported only in > 2.x AFAIK)
If you have bean-validation dependency on classpath (org.glassfish.jersey.ext:jersey-bean-validation:2.22.2) it should be picked up by the framework and work out of the box.
Also make sure that your @NotNull annotation comes from javax.validation.constraints package