Exclusive parameters or parameter groups


#1

I have a use case where there are two ways of querying the same resource. So there are query parameters that are mutually exclusive.

An example would be an api where you can query products either by brand and size, or by category

Valid queries would be

  • /products?brand&size
  • /products?category
    Invalid ones
  • /products?brand&category
  • /products?size&category

I have read the spec but I could not find any thing about it.


#2

What exactly are you hoping RAML will do or offer? Not quite clear if you are expecting some way to describe in RAML the conditions? It sounds more likely this is for documentation.


#3

Sorry for the late reply (don’t know how I missed yours “188 days” ago !
I was hoping for something kind of named query mechanism like the following :

/books:
  get:
    queries:
        byAuthor:
           description: "Query by author"
           queryParameters:
              author:
        byOthers
           description: "Note that you can't include author in this query"
           queryParameters:
               publicationYear:
               rating:
               isbn: