Different examples with different query parameters


#1

Hi,

My main issue regarding the RAML specification (0.8) concerns the example attribute, which is too simple.

I want to describe several examples depending on query parameters effectively given to the method.
It would be even better if I could put in such example fragment the value of a parameter

exemple: |
  {
    id: <<id>>
  }

with <<id>> the value of the path param or query param given to the request.

I want to write something like that :

exemple: 
     limit?: |
        {
          id: ...
        }
     type?: |
        {
          ...
          type: <<type>>
        }

which means : if parameter limit is presents, then first exemple. If type parameter is present, then, second exemple which owns a type attribute with the value of this parameter.
For the “and operator” between different parameters, we can imagine nested attribute or perhaps a more adequate syntax.

My main aim is to produce (generate) more accurate mocks, which could serve several responses depending on parameters.

But moreover, I want to build a tool in order to generate tests which validates a specification against an implementation.

The more precise is my spec, the more accurate will be my tests.

Did you have imagine evolutions in this sense for a future version of the RAML specifications.

Thank you very much.

Stéph.