我们与格式属性JSON模式,下面的代码片段:JSON模式 - 格式属性与JSON.Net
"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" ]
} }
我们正在使用从NewtonSoft的Json.Net解析器处理它。这用于正确解析先前版本的框架(v6.x),该框架仅支持草案3.使用支持草案4的最新版本的框架,我得到一个错误,即格式不能是数组。
我环顾四周,在草案3规范中没有看到任何说格式可以或不可以是数组的格式。 https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.23
然而,草案4明确指出格式必须是字符串。 http://json-schema.org/latest/json-schema-validation.html#anchor79
我正确地认为Json.Net框架在这方面不是向后兼容吗?或者,它在以前的版本中的工作方式是错误的?这将帮助我们相应地解决问题。谢谢。
你有一个缺少的闭合大括号? – 2015-02-18 00:00:58
@ nick-s是的,我喜欢。我已经纠正它,谢谢。 – Apeksha 2015-02-18 23:03:12