试图在 swagger 文档上运行 dredd。Dredd 失败并出现下一个错误:
- error: API description parser error in /albums.json:266 (from line 266 column 10 to column 21): Data does not match any schemas from 'anyOf'
- error: API description parser error in /albums.json:266 (from line 266 column 10 to column 21): No enum match for: s
- error: API description parser error in /albums.json:266 (from line 266 column 10 to column 21): Expected type array but found type string
错误指的是 JSON 的这一部分:
265 "photos": { "$ref": "#/definitions/PhotoEntity" },
266 "created_at": {
267 "type": "s",
268 "format": "g",
269 "description": "Дата создания"
270 }
gist提供完整的 JSON 。Swagger-ui 可以完美地使用这个 JSON,手动测试通过,正如预期的那样。