Open dviru opened 8 years ago
Remove schemas
node from common-schema.raml
. The RAML !include
tag basically appends the content of the included file on the node that you specified the !include
.
Just i need to remove "schemas:" node from "common-schema.raml" file? no need to change anything in main raml(file i am including the "common-schema.raml")? just i removed the "schemas:" from "common-schema.raml" file and tested. included file schema is over-written by main file schema
Sorry you are using composition :D Missed that bit ;) Do the following:
common-schema.raml
getSearchResponse: |
{
...
}
getOtherResponse: |
{
...
}
api.raml
#%RAML 0.8
title: Example API
baseUri: https://www.example.com/
protocols: [HTTPS]
schemas:
- !include common-schema.raml
- person: |
{
....
}
- asset: |
{
...
}
I did not tried that, but sequences in RAML 0.8 (sequences being the ones that start with dash) and composition (composition being you compose to sequences together) work like that.
Hi,
In raml we have defined set of schema which is related to particular raml, and we have some other common schema defined in "common-schema.raml". how can i define the include common-schema.raml in my RAML file, So RAML parser can pick both schema definition. My Current RAML looks like below and RAML parser only shows the current file schema definition. if defined include common-schema.raml file(schemas: !include common-schema.raml) after raml file schema definition section, then only i am seeing included raml file schema not raml file schema
common-schema.raml
Aha! Link: https://mulesoft-roadmap.aha.io/features/APIRAML-132