Dependencies between query prams


I’ve got a collection of objects. A user can narrow the collection down by specifying an object type and state. I prepared following trait to model that:


  • searchable:



    enum: [Type1, Type2, Type3]


    enum: [State1, State2, State3]

Above definition makes the users feel that it’s possible to use any combination, but it’s not quite right, as:

  • object of ‘Type1’ can take just ‘State1’,
  • object of ‘Type2’ can take ‘State2’ and ‘State3’,
  • object of ‘Type3’ can take ‘State1’, ‘State2’, ‘State3’.

How can I model this with RAML ?