【发布时间】:2014-07-30 01:09:04
【问题描述】:
我有一个 REST 服务,它返回一个字符串数组(即不是一个对象)。 Apiary 的相关 Blueprint markdown 如下:
+ Model (application/json)
+ Body
[
"element1",
"element2",
"element3"
]
+ Schema
{
"type": "array",
"items": {
"type": "string"
}
}
当我在 Apiary 中运行模拟服务时,它可以工作,但在 apiary 流量检查器中出现以下错误:
This API request was compared to a documented resource but was found invalid.
Check your request headers and body below.
...
JSON schema is not valid! invalid type: object (expected [object Object]/array)
at path "/items"
有什么技巧可以让它工作(对降价的更改),或者这是 Apiary 的一个错误?
【问题讨论】:
-
这不是有效的 JSON 模式。尝试使用 JSON Schema Generator 从数据中创建架构。
标签: jsonschema apiblueprint apiary