What is the correct syntax to reference the fragment?

A RAML example fragment named StudentExample.raml is placed in the examples folder in an API specification project.

What is the correct syntax to reference the fragment?
A . examples: !include StudentExample.raml
B. examples: #import StudentExample.raml
C. examples: !include examples/StudentExample.raml
D. examples: #import examples/StudentExample.raml

Answer: C

Explanation:

To include property. To keep the API definition concise, you can include external content, such as documentation, schemas, and frequently used patterns outside the definition itself. The parser interprets !include as if the content of the externally-hosted file or a URL were declared in-line.

To use the fragments in RAML you have to include the exact path(copy the path) of that fragment you want to use as shown below

Option 3 is the correct as correct syntax is examples: !include examples/StudentExample.raml

Reference: https://docs.mulesoft.com/api-manager/1.x/tutorial-design-an-api

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments