Describing URI parameters in RAML
Asked Answered
M

1

6

I'm declaring a REST service API stub in RAML. My web application provides equipment, which can be listed, obtained by id or by code. When I want the whole list, I don't specify any URI parameter, however, to get a concrete equipment, I do. That's its current state:

/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

Here, in description fields I write what the current call performs. However, I would like to add a description for the parameter passed in the URI itself (id or code). Is there a way to achieve it?

Manlove answered 23/9, 2014 at 14:47 Comment(0)
Z
8

You are missing uriParameters sections to describe the equipmentId and code parameters. In such section, you can specify the usual: type, description...

See section Template URIs and URI Parameters in the spec: https://github.com/raml-org/raml-spec/blob/master/versions/raml-08/raml-08.md#template-uris-and-uri-parameters

Zoo answered 24/9, 2014 at 13:56 Comment(1)
the uriParameters section is optionalBurning

© 2022 - 2024 — McMap. All rights reserved.