title: Spring and @JsonView with multiple identifiers
body: <p>Spring supports <code>@JsonView</code> since version 4.1.</p>
  
  <p>Annotating a Spring contoller's (annotated with <code>@RestController</code>) method with <code>@JsonView</code> that has multiple identifiers I got the following exception:</p>
  
  <pre><code>java.lang.IllegalArgumentException: @JsonView only supported for request body advice with exactly 1 class argument: org.springframework.web.method.HandlerMethod$HandlerMethodParameter@a566e37e
  </code></pre>
  
  <p>Apparently according to the <code>JsonViewResponseBodyAdvice</code>'s <a href="https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/servlet/mvc/method/annotation/JsonViewResponseBodyAdvice.html" rel="noreferrer">Javadoc</a> the following is true:</p>
  
  <blockquote>
    <p>Note that despite @JsonView allowing for more than one class to be
    specified, the use for a response body advice is only supported with
    exactly one class argument. Consider the use of a composite interface.</p>
  </blockquote>
  
  <p>Likewise when annotating a controller's method argument (annotated with <code>@RequestBody</code>) also with <code>@JsonView</code> that has multiple identifiers; according to the <code>JsonViewRequestBodyAdvice</code>'s <a href="https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/servlet/mvc/method/annotation/JsonViewRequestBodyAdvice.html" rel="noreferrer">Javadoc</a>:</p>
  
  <blockquote>
    <p>Note that despite @JsonView allowing for more than one class to be
    specified, the use for a request body advice is only supported with
    exactly one class argument. Consider the use of a composite interface.</p>
  </blockquote>
  
  <p>Does anybody knows if a fix is planned? My current Spring version is 4.2.4.</p>
  
  <p>This would be extremely useful creating json views for public, private (extending public), summary and detailed (extending summary) views and then combining them in the controller methods!</p>