From 45ca8f24b0b9acbc5d9cd05c80ce77bb9458f7b5 Mon Sep 17 00:00:00 2001 From: Gavin King Date: Fri, 25 Oct 2024 08:11:58 +0200 Subject: [PATCH] fix broken code example Signed-off-by: Gavin King --- .../src/main/asciidoc/introduction/Introduction.adoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/documentation/src/main/asciidoc/introduction/Introduction.adoc b/documentation/src/main/asciidoc/introduction/Introduction.adoc index d7d33e0978..861aa5023c 100644 --- a/documentation/src/main/asciidoc/introduction/Introduction.adoc +++ b/documentation/src/main/asciidoc/introduction/Introduction.adoc @@ -533,8 +533,8 @@ Whatever the case, the code which orchestrates a unit of work usually just calls [source,java] ---- @GET -@Path("books/{titlePattern}") -public List findBooks(String titlePattern) { +@Path("books/{titlePattern}/{page:\\d+}") +public List findBooks(String titlePattern, int page) { var books = sessionFactory.fromTransaction(session -> Queries.findBooksByTitleWithPagination(session, titlePattern, Page.page(RESULTS_PER_PAGE, page)); @@ -565,8 +565,8 @@ We can call it just like we called our handwritten version: [source,java] ---- @GET -@Path("books/{titlePattern}") -public List findBooks(String titlePattern) { +@Path("books/{titlePattern}/{page:\\d+}") +public List findBooks(String titlePattern, int page) { var books = sessionFactory.fromTransaction(session -> Queries_.findBooksByTitleWithPagination(session, titlePattern, Page.page(RESULTS_PER_PAGE, page));