Why do we use | for parameters that are includes?


In the RAML 200 tutorial, a readOnlyCollection resourceType is defined, which takes an exampleCollection as a parameter. But this is given as:

     example: |

(I’m not sure if it is relevant, but exampleCollection is filled in later using !include.)

Why is the pipe character used there? It’s only one line. Why couldn’t it be like this?

     example: "<<exampleCollection>>"

And in general, how do I know when I need to use a | with parameters, and when not to?


Hi, you can also write everything in one line example: <<exampleCollection>>. The pipe is coming from YAML notation.