fix: misleading example for fetching books with EAN

This commit is contained in:
Ninjdai 2025-07-30 22:59:48 +02:00
parent 5d709d658b
commit 4aa5cf463f

View file

@ -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")
),