How to set multiple example requests and its responses in RAML

2.6k views Asked by At

Can you tell me how to set in RAML 1.0, if its even possible, multiple requests and its responses as examples. I have in anypoint studio 5 api's and I want to merge them into one. I wanted to merge all raml files but dont know how to do it. In every raml is only one post method with one request and one response. So, If I POST one request in ARC, I want to get appropriate response.

1

There are 1 answers

2
aled On

There is a guide to defines examples in the documentation.

For multiple examples you can use Named Examples with the examples: facet in RAML. Do confuse with example: which is for a single example. Named Examples require an identifier.

...
examples:
   MyExample1:
      ...
   AnotherExample:
      ...

You can just use the examples: facet to include the examples from another file.