title: Resource query parameter validation on jersey-dropwizard
body: <p>I have a <a href="http://www.dropwizard.io/" rel="nofollow">dropwizard</a> application and in one resource i would like to have a required query parameter. I know jersey supports <a href="https://jersey.java.net/documentation/latest/bean-validation.html" rel="nofollow">bean validation</a> so i tried to use @NotNull annotation but it didn't work. Here's the code to resource:  </p>
  
  <pre><code>@Path("/resource/{id}")
  @Produces(MediaType.APPLICATION_JSON)
  public class MyResource {
      //....constructor...
  
      @GET
      public String test(
          @PathParam("id") long id,
          @NotNull @QueryParam("required_param") long param) {
          //....
      }
  }
  </code></pre>
  
  <p>In case it isn't clear, what i want to happen is whenever the client sends a request without the parameter <em>required_param</em> i want to return an error.</p>
  
  <p>After reading the docs i thought maybe dropwizard's configuration would be the reason. So i added this piece of code into my application's run method:</p>
  
  <pre><code>environment.jersey().property("jersey.config.disableAutoDiscovery", false);
  environment.jersey().property("jersey.config.server.disableAutoDiscovery", false);
  environment.jersey().property("jersey.config.beanValidation.disable.server", false);
  </code></pre>
  
  <p>Unfortunately this didn't work either. Anyone has an idea on how to do this? </p>