diff --git a/src/main/kotlin/routes/IndexRoute.kt b/src/main/kotlin/routes/IndexRoute.kt index 4b6bb4b..7944157 100644 --- a/src/main/kotlin/routes/IndexRoute.kt +++ b/src/main/kotlin/routes/IndexRoute.kt @@ -3,7 +3,7 @@ package be.simplenotes.c2c.routes import be.simplenotes.c2c.templates.render import com.mitchellbosecke.pebble.PebbleEngine import org.http4k.contract.ContractRoute -import org.http4k.contract.bindContract +import org.http4k.contract.meta import org.http4k.core.HttpHandler import org.http4k.core.Method import org.http4k.core.Response @@ -12,7 +12,9 @@ import org.http4k.core.Status class IndexRoute(private val engine: PebbleEngine) { fun route(): ContractRoute { - val spec = "/" bindContract Method.GET + val spec = "/" meta { + summary = "Redoc ui" + } bindContract Method.GET val route: HttpHandler = { Response(Status.OK).body(engine.render("index")) diff --git a/src/main/kotlin/routes/PdfRoute.kt b/src/main/kotlin/routes/PdfRoute.kt index 1c0189b..418e260 100644 --- a/src/main/kotlin/routes/PdfRoute.kt +++ b/src/main/kotlin/routes/PdfRoute.kt @@ -16,7 +16,7 @@ class PdfRoute(private val api: Api, private val pdfCreator: PdfCreator) { fun route(): ContractRoute { val spec = "/route" / Path.of("id", "Route's ID") / "pdf" meta { - summary = "Route details" + summary = "Generate pdf from routes" } bindContract Method.GET fun route(id: String, pdf: String): HttpHandler = { diff --git a/src/main/kotlin/routes/SearchRoute.kt b/src/main/kotlin/routes/SearchRoute.kt index 19bba4d..71b530a 100644 --- a/src/main/kotlin/routes/SearchRoute.kt +++ b/src/main/kotlin/routes/SearchRoute.kt @@ -19,7 +19,7 @@ class SearchRoute(private val api: Api) { val spec = "/search" meta { summary = "Search routes and waypoints" - tags += Tag("Query") + queries += query returning(Status.OK, responseLens to SearchResults(listOf(RouteResult( id = "57103", title = "Tour de Bavon : Thor", diff --git a/src/main/resources/views/index.twig b/src/main/resources/views/index.twig index 61c6b28..c10fd97 100644 --- a/src/main/resources/views/index.twig +++ b/src/main/resources/views/index.twig @@ -1,11 +1,19 @@
- - -