title: Dropwizard/Jersey: Authentication and JSON parameter
body: <p>I'd like to have a method like this for the REST interface of a resource</p>
  
  <pre><code>@POST
  @Consumes(MediaType.APPLICATION_JSON)
  public void add(@Auth User user, @Valid Food food) {
      //consume
  }
  </code></pre>
  
  <blockquote>
    <p>However, this is not possible as I get an error like:
    "SEVERE: Missing dependency for method public void com.restaurant.FoodResource.add(com.restaurant.User,
    com.restaurant.Food) at parameter at index 0
      SEVERE: Missing dependency for method public void com.restaurant.FoodResource.add(com.restaurant.User,
    com.restaurant.Food) at parameter at index 1
      SEVERE: Method, public void com.restaurant.FoodResource.add(com.restaurant.User,
    com.restaurant.Food), annotated with POST of resource, class com.restaurant.FoodResource, is not recognized as valid resource method.</p>
  </blockquote>
  
  <p>I found that it is not possible to have two parameters not annotated with certain annotations according to the specifications (3.3.2.1 Entity Parameters) <a href="http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html">http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html</a></p>
  
  <p>What options exist to still do something like this? The ones that come to my mind is an object that encapsulates User and Food, but that doesn't seem to be like a nice solution to me. </p>
  
  <p>Is there any other more elegant way to do something like this? Can i send the JSON Food representation as @PathParam?</p>