I have a rest api with a type "Entity", this Entity has a list of children which themselves are also type Entity
Accessing the resources is as follows:
Get Children of an entity:
GET /api/entities/{id}/children
Get Single entity:
GET /api/entities/{id}
For removing resources I currently have the following planned:
Remove child from parent but keep child resource in database (delete ONLY the relation):
DELETE /api/entities/{id}/children/{childId} (calling GET /api/entities/{childId} will still return this resource!)
Remove entity from database:
DELETE /api/entites/{id}
Is this the common practice in REST API design for differentiating between removing a relationship vs removing a resource? Or is it expected that the child resource will be both removed from the hierarchy and completely deleted as well? What are the common ways to differentiate these two actions?