Description of URI Parameters in RAML

I declare a REST service API stub in RAML . My web application provides equipment that can be listed by an identifier or code. When I need the whole list, I do not specify the URI parameter, however, to get the specific equipment, I do it. This is his 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 the description fields I write what the current call is doing. However, I would like to add a description for the parameter passed in the URI itself ( id or code ). Is there any way to achieve this?

+6
source share
1 answer

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

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

+7
source

Source: https://habr.com/ru/post/975724/


All Articles