Aglio 不允许将 body 中的参数定义为参数

Aglio does not allow parameters in the body to be defined as parameters

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 端点的定义不符合标准?

指定消息正文属性的正确方法是使用新的 MSON 属性语法,从 Aglio 2.0 开始,它用于呈现 JSON 和 JSON 架构。

### Create journey [POST]
Create a new journey

+ Parameters
    + origin (required) - origin location of journey

+ Attributes
    + destination: some_other_place (required) - destination location of journey

+ Request
    + Headers

                Accept: application/json
                Authorization: Basic 

在不久的将来,Aglio 将呈现属性的额外信息。