I'm using IBM API Connect for a Loopback application. I've 3 models - owner, home and room. The relationship is described as follows:
OWNER:
- an owner might have one or more than one home(s)
- a home or all of the homes belong to a particular owner
HOME:
- a home would have more than one rooms
- all of the rooms belongs to a particular home
In my case, through API Connect CLI, Owner is an REST exposed model (REST resource) and is supposed to be directly related to the Home model via one-to-many relationship. Home & Room are two models which are not exposed to REST. Home is directly related to Room via one-to-many relationship. Owner and Room are not directly related to each other but is related via Home model.
I want to get the HTTP URL in these forms:
/owners/{id}/homes/{id}/rooms/{id}
to get details of a room for a particular home of the owner
I've chosed one-to-many relationship for Owner-Home and Home-Room with respective foreign key. Since its not a many-to-many relationship, I did not use any through model.
The URLs that I'm getting doesn't have any Room counterpart :
/owners/{id}/homes/{id}
Any ideas how can I do that?