Skip to content

Enable nested exposure of Siblings

Compare
Choose a tag to compare
@twof twof released this 02 Oct 05:40
· 84 commits to master since this release

Siblings can now be exposed alongside Children and Parents

try router.crudRegister(for: Todo.self) { controller in
    try controller.crudRegister(forSiblings: \.tags)
}
try router.crudRegister(for: Tag.self) { controller in
    try controller.crudRegister(forSiblings: \.todos)
}

exposes

GET /todo/:id
GET /todo
POST /todo
PUT /todo/:id
DELETE /todo/:id
GET /todo/:id/tag/:id
GET /todo/:id/tag
POST /todo/:id/tag
PUT /todo/:id/tag/:id
DELETE /todo/:id/tag/:id
GET /tag/:id
GET /tag
POST/tag
PUT /tag/:id
DELETE /tag/:id
GET /tag/:id/todo/:id
GET /tag/:id/todo
POST /tag/:id/todo
PUT /tag/:id/todo/:id
DELETE /tag/:id/todo/:id