【发布时间】:2014-11-17 20:06:34
【问题描述】:
我在 RAML 中声明一个 REST 服务 API 存根。我的web应用提供了设备,可以列出,可以通过id或者code获取。当我想要整个列表时,我不指定任何 URI 参数,但是,为了获得具体的设备,我会这样做。这是它的当前状态:
/equipment:
get:
body:
application/json:
application/xml:
description:
List all the equipment
/id/{equipmentId}:
get:
body:
application/json:
application/xml:
description:
Get an equipment by id
/code/{code}:
get:
body:
application/json:
application/xml:
description:
Get an equipment by code
在这里,在description 字段中,我写下了当前调用的执行情况。但是,我想为 URI 本身中传递的参数添加说明(id 或 code)。有没有办法实现?
【问题讨论】: