对我的API使用节点dredd。我选择使用yml文件,因为这是我的团队熟悉的std。
下面是我们有一个功能正常的代码片段:
/api/station/{id}:
get:
produces:
- application/json; charset=utf-8
parameters:
- name: id
in: path
required: true
type: string
description: DynamoDB ID of the station to edit
x-example: 'daf04a00-c3bf-11e7-a913-b76623d265c4'
responses:
200:
description: Returns a single station
schema:
$ref: '#/definitions/station'我想我可以猜出如何定义备用响应对象,我假设只需添加到对象中,例如:
responses:
200:
description: Returns a single station
schema:
$ref: '#/definitions/station'
422:
description: Failed validation有一个例子说明如何向同一个端点发送多个请求。但这是API蓝图格式,而不是yaml格式。
有人知道如何使用yaml格式将多个请求传递给同一个端点吗?我看不见任何关于如何做到这一点的文档。
https://stackoverflow.com/questions/47183930
复制相似问题