We have a JSON schema with format property, snippet below:
"properties": {
"expireDateTime": {
"description": "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",
"type": "string",
"format": [ "date-time", "date" ]
} }
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.
I looked around and did not see anything in the draft 3 spec that says that format can or cannot be an array. https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.23
However, draft 4 clearly states that format must be a string. http://json-schema.org/latest/json-schema-validation.html#anchor79
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.