title: JSON Schema - format property with JSON.Net
body: <p>We have a JSON schema with format property, snippet below:</p>
  <pre><code>&quot;properties&quot;: {
          &quot;expireDateTime&quot;: {
          &quot;description&quot;: &quot;Date when the time will expire.  If granularity is at the date level then YYYY-MM-DD is passed.  If the granularity is at the hour/minute level then the date time format is YYYY-MM-DDThh:mm:ss+-hh:mm&quot;,
          &quot;type&quot;: &quot;string&quot;,
          &quot;format&quot;: [ &quot;date-time&quot;, &quot;date&quot; ]
          } }
  </code></pre>
  <p>We are processing it using the Json.Net parser from NewtonSoft. This used to parse correctly with the previous version of the framework (v6.x), which only supported draft 3. With the latest version of the framework that supports draft 4, I get an error that format cannot be an array.</p>
  <p>I looked around and did not see anything in the draft 3 spec that says that format can or cannot be an array. <a href="https://datatracker.ietf.org/doc/html/draft-zyp-json-schema-03#section-5.23" rel="nofollow noreferrer">https://datatracker.ietf.org/doc/html/draft-zyp-json-schema-03#section-5.23</a></p>
  <p>However, draft 4 clearly states that format must be a string. <a href="http://json-schema.org/latest/json-schema-validation.html#anchor79" rel="nofollow noreferrer">http://json-schema.org/latest/json-schema-validation.html#anchor79</a></p>
  <p>Am I correct in assuming that the Json.Net framework is not backward compatible in this aspect? Or was the way it worked in the previous versions erroneous? It will help us handle the problem accordingly. Thanks.</p>