RAML to get collection item more than one way


Hi, newbie questions here.

I am familiar with the common pattern:



But if there are more than one way to get an item, how would the RAML define:



/[get by parameters 1, 2, and 3]

For example, you can get a person by their id; or by the complete set of firstname, lastname and date of birth.

Is the basic idea that a new nested resource would need to be defined for each way items can be retrieved?

But then can you have more than one resource nested under the main collection?

E.g., could you have different methods defined such as:




Yes, you use indentation to nest as much REST based uris as you need. To define something similar to your example you could use:


Yes definitely there are a lot of methods by which you can identify a particular record.
In your example using {CollectionID} you can find the record but you can also filter the collection using some other parameters such as {Album} , or {Genre} or by {Artist} or by {Language} or by {Year released} to sort your results for a list of songs


yes, you can have more than one resource nested under the main collection. and you can use the resource as /{collection_id} to set each item data.