title: HTTP Status code and Response Body in HTTP POST for data validation
body: <p>Let's suppose to have an HTTP POST that accept as input a JSON with some data and it must validate these data. The method should return also a validation message in the response body.</p>
  
  <p>Ex.</p>
  
  <pre><code>{
     "A" : 1,
     "B" : 1,
     "C" : 3
  }
  </code></pre>
  
  <p>Suppose to have some validation rules defined over the JSON, for example (A + B) should be less than C parameter.</p>
  
  <p>I have some doubts about the HTTP status code.</p>
  
  <ul>
  <li>If the JSON is valid the HTTP POST should returns 200</li>
  <li>If the JSON is not valid (missing parameters or wrong types) the HTTP POST should returns 400</li>
  </ul>
  
  <p>But in case the JSON is valid (there are all the requested parameters and the types are correct) but the parameters don't respect the defined rules (A + B &lt; C) what should be the HTTP Status?</p>
  
  <ul>
  <li>200 and than an explanation in the response body? </li>
  <li>400 and the explanation in the response body?</li>
  </ul>
  
  <p>Is there the need to differentiate the HTTP Status from the Validation rules Status? </p>
  
  <p>Cheers</p>