title: How to format date field in JSON POST request to insert into SQL database?
body: <p>I need to send a POST request with the following JSON body:</p>
  <pre><code>{
   &quot;date&quot;: &quot;2020-08-21&quot;
  }
  </code></pre>
  <p>The date field has java.sql.Date type. This request results in an error which says that it could not deserialize the given string &quot;2020-08-21&quot; to sql.Date. If I change the JSON by adding some kind of time:</p>
  <pre><code>{
   &quot;date&quot;: &quot;2020-08-21 00:00:00&quot;
  }
  </code></pre>
  <p>It works fine. However, I would like to be able to send only Date values without the time, and be able to convert it to sql.Date. Any ideas on how to work around this? I would really not like to use a String for date and then map it to Date. Are there better ways to do this?</p>