Let's say I have a collection of cars, all identified by VIN, such that cars/xyz123
will return the car with that VIN. Furthermore, I can get subsystems (children) by using URIs similar to cars/xyz123/drivetrain
and cars/xyz123/chassis
.
Given a situation where I have a car without a VIN but with a distinct nickname, what would be the most appropriate way of constructing the path to that resource? I know the typical approach would be something like cars?nickname=herbie
, but I'm not super happy with the implications of accessing child resources with something like cars/drivetrain?nickname=herbie
. I prefer the idea of something like cars/bynickname/herbie/drivetrain
.
I feel like my preferred approach is pragmatic and acceptable, but I would really appreciate some feedback. Thanks for any insight you've got!