restdocumentation-generationraml

How to create example of arrays in RAML v1.0


I am trying to create an example of array in RAML v1.0. I do not think it is specified in specification document. I can not find it there.

I need this output in resource example section:

{ tracks: 
    [{
      track:12
    },
    {
      track:121
    }]
 }

Solution

  • I usually use this way...

    tracks
    type: array
    items:
      properties: 
        releasedate: datetime
        album: string
        artist: string
        year: number