Okay this is ridiculous: (or probably my design is :)
Here are the URLs that we are using:
/{projectName}/{wallName} - GET only: fetch all win conditions posted to the all
/{projectName}/WinCondition - POST a new Win Condition
/{projectName}/WinCondition/{id} - GET, PUT & DELETE
Now the funny part:
If the code is ordered as above the call POST: /myProject/WinCondition
gets routed to the first route with wallName! And thus get a 405.
If I shift the /{projectName}/{wallName}
to the bottom then it gets routed correctly!
Now here's what I know:
- The default routing mode in Restlet is MODE_FIRST_MATCH. I set that to MODE_BEST_MATCH and the order of URLs still matters! I am unable to access the 'affinity' score to check what's the problem/score. Matching mode is Template.MODE_EQUALS.
The question is then this: Do I have to be concerned with how I order the URLs in my java file???? That'll be scary, even from a maintenance point of view.
Any suggestions? Should I redesign my URLs?? But the 'structure' still tends to be the same leading to the same problem