Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Describing URI parameters in RAML

Tags:

rest

api

raml

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?

like image 795
Xtreme Biker Avatar asked Sep 23 '14 14:09

Xtreme Biker


1 Answers

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

like image 169
David Dossot Avatar answered Sep 27 '22 22:09

David Dossot