Hot to include multiple traits as arrays


Although the specs look unclear to me it looks like you should be able to include multiple traits by using YAML arrays instead of the usual maps. At least this seems to be the favorite approach for the people @SAP (see for example here:
In these cases the included file should also contain the key, so instead of using

  paged: !include paged.raml
  sortable: !include sortable.raml

you use:

  - !include paged.raml
  - !include sortable.raml

where paged.raml starts with “paged:” and sortable.raml with “sortable:”.

Point is: I found no way to have this digested by raml-to-jax-rs, it complains about “Invalid element Array”.
Is this a limitation of raml-to-jax-rs or it is a misinterpreted feature of the specs?


I can confirm that your second example is NOT valid RAML 1.0

From the Spec[1]:

The value of this node is a map where key names become names of traits that can be referenced throughout the API, and values are trait declarations.