【发布时间】:2015-10-06 02:57:13
【问题描述】:
我正在尝试使用 Swagger 2.0 为端点创建示例响应。
200:
description: Successful response
schema:
type: object
$ref: "#/definitions/User"
examples:
application/vnd.api+json:
- data:
attributes:
full_name: John Appleseed
- data:
attributes:
full_name: Mike Appleseed
我的 api 消费并产生application/vnd.api+json,但它不会识别它。如果我删除这些示例,我的规范就会起作用。知道如何指定它吗?
【问题讨论】:
-
这是由于用于验证的 JSON Schema 中存在的一个错误。虽然它已被修复,但编辑器更新需要几天时间。
标签: swagger json-api swagger-2.0