title: Jackson ignore @Size when serializing
body: <p>I have a situation in which I want to return a request to a user if it fails validation along with an appropriate error message. The problem that I've run across is that I'm using Jackson to deal with the JSON request, and the failure in validation also causes Jackson to fail to serialize the message.</p>
  
  <p>For instance, if I have this object:</p>
  
  <pre><code> public class SomeRequest
   {
       @Size(min=1, max=10)
       private String someField;
       //getter and setter here
   }
  </code></pre>
  
  <p>...when I go to serialize when the field is invalid (let's say it has 11 characters in it)...</p>
  
  <pre><code> ObjectMapper mapper = new ObjectMapper();
   output = mapper.writeValueAsString(someRequestInstance);
  </code></pre>
  
  <p>...I get a JsonProcessingException (Error(s) validating object).  I've confirmed that a valid object has no problem with serialization.  <strong>So my question is this</strong>: How do I get Jackson to ignore the javax.validation annotations when serializing?</p>
  
  <p>Thanks in advance!</p>