Is there any REST convention for handleling resources with slashes?
For instance, let's say a normal REST resource works like this:
/ice cream/chocolate
- returns the ingredients of chocolate ice cream/ice cream/rocky road
- returns the ingredients of rocky road ice cream/ice cream/strawberry/banana
- returns the stawberry banana ingredients
Only /ice cream/strawbery/banana
doesn't quite work because that looks like a resource for strawberry with a subcomponent of banana.... not quite what we're going for.
When you try to escape the '/'
with '%2F'
many web servers (including glassfish and apache) block this by default as a possible security violation. There are server overrides, but then I'd need to get a different team involved... I'd rather just handle it myself.
So what is one with a RESTful mind to do? I can't very well prevent someone from naming their ice cream 'strawberry/banana'.
I was thinking of using some custom escape sequence like stawberry*slash*banana
and then force any display component to do the conversion on their end, but I thought others must have faced similar issues, so why not ask for the best practice (or at least for some ideas that make sense)?