POST /authors Body:
{
"name": "Author Name"
}
Response: 201 Created, returns created author object Errors: 400 if name is missing or invalid
GET /authors Returns array of all authors
GET /authors/:id Returns author object Errors: 404 if author not found
PUT /authors/:id Body:
{
"name": "Updated Name"
}
Response: 200 OK, returns updated author object Errors: 400 if name is missing or invalid, 404 if author not found
DELETE /authors/:id Response: 204 No Content Errors: 404 if author not found
GET /authors/:id/books Returns array of books for the author
POST /books Body:
{
"isbn": "1234567890",
"title": "Book Title",
"authorId": 1
}
Response: 201 Created, returns created book object Errors: 400 if any field is missing or invalid, 404 if authorId does not exist
GET /books Returns array of all books
GET /books/:id Returns book object Errors: 404 if book not found
PUT /books/:id Body:
{
"isbn": "0987654321",
"title": "Updated Title",
"authorId": 2
}
Response: 200 OK, returns updated book object Errors: 400 if any field is missing or invalid, 404 if book not found
DELETE /books/:id Response: 204 No Content Errors: 404 if book not found