在RAML中描述URI参数

Xtr*_*ica 6 api rest raml

我在RAML中声明了一个REST服务API存根.我的Web应用程序提供了可以列出的设备,可以通过id或代码获得.当我想要整个列表时,我没有指定任何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
Run Code Online (Sandbox Code Playgroud)

在这里,description我写了当前调用执行的内容.但是,我想为URI本身(idcode)传递的参数添加一个描述.有没有办法实现它?

Dav*_*sot 8

您缺少uriParameters用于描述equipmentIdcode参数的部分.在这样的部分,您可以指定通常:type,description...

请参阅规范中的模板URI和URI参数部分:https://github.com/raml-org/raml-spec/blob/master/versions/raml-08/raml-08.md#template-uris-and-uri α参数