【发布时间】:2014-11-19 17:28:40
【问题描述】:
我正在使用 Markdown 生成文档 (aglio)、生成模拟 (api-mock) 并检查完整性约束 (dredd)。
使用 Dredd,检查对象没有问题,PUT 或 POST 没有问题,但是列表有问题。
我的列表是数组,但是当我写这个模式时:
{
"title": "Videos List",
"type": "array",
"items": {
"type":"object",
"required":false,
"properties": {
"id": {
"type": "string",
"required": true
}
},
"required": true
}
}
我总是遇到同样的错误:body: JSON schema is not valid! invalid type: object (expected [object Object]/array) at path "/items"
我一次又一次地尝试了 3 个小时,但我失败了。
请帮忙!
PS:对不起我的英语,我是法国人。
【问题讨论】:
-
您能否发布失败的 PUT 或 POST 正文的示例?
标签: jsonschema apiary dredd