title: In .Net Core API, ModelState.IsValid is not catching Required parameters
body: <p>.Net Core 3.1 API.  I've read a lot of threads that ask about why ModelState.IsValid isn't working as expected. Most are for web pages and not API's. And the ones I have found about API's either don't exactly apply or didn't lead me to an understanding.</p>
  
  <p>I have a model that looks like this:</p>
  
  <pre><code>public class MyModel
  {
      [Required(ErrorMessage = "Prop1 is required.")]
      public int Prop1 { get; set; }
  
      public List&lt;int&gt; IntList { get; set; }
  }
  </code></pre>
  
  <p>And I have an API endpoint:</p>
  
  <pre><code>[ApiController]
  [Route("api/[controller]")]
  public class FooBarController : ControllerBase
  {
      [HttpPost]
      public async Task&lt;IActionResult&gt; Post([FromBody] MyModel request)
      {
          if (!ModelState.IsValid)
              return BadRequest(ModelState);
  
          // do stuff
  
          return Ok(results);
  
      }
  }
  
  </code></pre>
  
  <p>Now, in Postman, if I pass this as the body, it works as expected:</p>
  
  <pre><code>{ "Prop1": 1001}
  </code></pre>
  
  <p>But if I pass this, I would expect an error of <code>Prop1 is required.</code> to be thrown:</p>
  
  <pre><code>{ "Prop2": 1001}
  </code></pre>
  
  <p>However, there is no error. The model is still valid and I just get back an empty set.</p>