diff --git a/src/routes/book.rs b/src/routes/book.rs index a799290..2314e0e 100644 --- a/src/routes/book.rs +++ b/src/routes/book.rs @@ -21,7 +21,10 @@ struct BookByIdParams(u32); path = "/book/id/{id}", params(BookByIdParams), responses( - (status = OK, body = book::Model, description = "Found book with corresponding ID in the database"), + (status = OK, body = book::Model, description = "Found book with corresponding ID in the database", examples( + ("Found regular book" = (value = json!({"author": "Pierre Bottero", "ean": "9782700234015", "id": 5642, "title": "Ellana l'envol"}))), + ("Book doesn't have an EAN" = (value = json!({"author": "Author B. Ook", "ean": "", "id": 1465312, "title": "Itsabook"}))) + )), (status = NOT_FOUND, description = "No book with this id exists in the database") ), summary = "Get a book by its internal ID", @@ -51,8 +54,7 @@ struct BookByEanParams(String); params(BookByEanParams), responses( (status = OK, body = book::Model, description = "Found book with corresponding EAN", examples( - ("Found regular book" = (value = json!({"author": "Pierre Bottero", "ean": "9782700234015", "id": 5642, "title": "Ellana l'envol"}))), - ("Book doesn't have an EAN" = (value = json!({"author": "Author B. Ook", "ean": "", "id": 1465312, "title": "Itsabook"}))) + ("Found regular book" = (value = json!({"author": "Pierre Bottero", "ean": "9782700234015", "id": 5642, "title": "Ellana l'envol"}))) )), (status = NOT_FOUND, description = "No book with this EAN found in the database or on openlibrary") ),