Answer the question
In order to leave comments, you need to log in
Is it possible in RAML to specify an associated type for a top-level resource?
Hello.
Learning RAML, writing API output myself, there is a need to do the following thing: when outputting the resource section of the documentation, output the type that is associated with each resource. That is, there is, for example, a /orders resource, I want the following output:
Orders (displayName)
then some description (description) then a
description of the Order type with parameters.
and then a description of all methods.
In the RAML specification, I did not find either a standard such possibility, or the ability to specify a custom field when describing a resource. Is it even possible?
Answer the question
In order to leave comments, you need to log in
Specifying a type on a resource is meaningless.
The variant with ResourceType works well:
/Organizations:
type: collection-item
/{guid}:
type: item
#%RAML 1.0 ResourceType
description: Элемент <<resourcePathName | !singularize>>
uriParameters:
guid:
pattern: |
[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
get:
is: [secured]
description: Получить элемент <<resourcePathName | !singularize>>
responses:
200:
body:
application/json:
type: <<resourcePathName | !singularize>>
404:
description: Ресурс не найден
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question