Aglio 是一种 API 蓝图渲染器,不允许将请求正文中的参数包含在端点规范的参数部分中。它抛出解析警告如下:
parameter '<some_parameter>' not specified in '<some_description>' its '<some_URI_template>' URI template (warning code 8)
复制此警告的示例 Markdown 是:
## Journey creation [/v1/journeys/{origin}]
### Create journey [POST]
Create a new journey
+ Parameters
+ origin (required) ... origin location of journey
+ destination (required) ... destination location of journey
+ Request
+ Headers
Accept: application/json
Authorization: Basic <BASIC_AUTH_TOKEN>
+ Body
{
"destination" : "some_other_place"
}
+ Response 200 (application/json)
+ Body
{
"origin" : "some_place",
"destination" : "some_other_place",
"journey_state" : "Not_Started",
"timestamp" : "<dateuuid>",
}
渲染不喜欢 'destination' 作为参数,因为它不在 URI 模板中。
我的问题是,这是该工具的一个缺点,还是 API 蓝图规范?另外,也许,REST 端点的定义不符合标准?