In some cases we can have a relationship between two entities, for the sake of the example let's say User and Dummy. The relationship is a unidirectional one to one owned by User. In this case, there is not much interest to expose Dummy, so we might end up willing to expose the whole entity Dummy when accessing to a User resource and manage this entity via User. However this causes two problems:
- This won't work because an error will be thrown stating that
Dummy is not a resource
- It won't be possible to update
Dummy via User
It may be simpler to keep the current behavior because I'm not sure this case is very RESTful like but I think it would at least deserve a mention in the doc as when dealing with relationships, all related entities must be declared as resources too. Maybe a note after the service declaration.
In some cases we can have a relationship between two entities, for the sake of the example let's say
UserandDummy. The relationship is a unidirectional one to one owned byUser. In this case, there is not much interest to exposeDummy, so we might end up willing to expose the whole entityDummywhen accessing to aUserresource and manage this entity viaUser. However this causes two problems:Dummyis not a resourceDummyviaUserIt may be simpler to keep the current behavior because I'm not sure this case is very RESTful like but I think it would at least deserve a mention in the doc as when dealing with relationships, all related entities must be declared as resources too. Maybe a note after the service declaration.