From 4aa5cf463ffe531bfb5fd2291e4c286c4d41cad0 Mon Sep 17 00:00:00 2001 From: Ninjdai Date: Wed, 30 Jul 2025 22:59:48 +0200 Subject: [PATCH] fix: misleading example for fetching books with EAN --- src/routes/book.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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") ),