From e08c8778640967cc086a922f178b18e08b313a29 Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Fri, 17 Jan 2025 13:40:43 +0100 Subject: feat(server): Bundle swagger ui --- .../main/kotlin/moe/nea/ledger/server/core/Application.kt | 4 ++++ .../main/kotlin/moe/nea/ledger/server/core/api/BaseApi.kt | 13 +++++++++++++ 2 files changed, 17 insertions(+) (limited to 'server/core/src') diff --git a/server/core/src/main/kotlin/moe/nea/ledger/server/core/Application.kt b/server/core/src/main/kotlin/moe/nea/ledger/server/core/Application.kt index f00f26d..0f13606 100644 --- a/server/core/src/main/kotlin/moe/nea/ledger/server/core/Application.kt +++ b/server/core/src/main/kotlin/moe/nea/ledger/server/core/Application.kt @@ -14,6 +14,7 @@ import moe.nea.ledger.server.core.api.Documentation import moe.nea.ledger.server.core.api.Info import moe.nea.ledger.server.core.api.apiRouting import moe.nea.ledger.server.core.api.openApiDocsJson +import moe.nea.ledger.server.core.api.openApiUi import java.io.File fun main(args: Array) { @@ -46,6 +47,9 @@ fun Application.module() { route("/api.json") { openApiDocsJson() } + route("/openapi") { + openApiUi("/api.json") + } } } diff --git a/server/core/src/main/kotlin/moe/nea/ledger/server/core/api/BaseApi.kt b/server/core/src/main/kotlin/moe/nea/ledger/server/core/api/BaseApi.kt index ad05118..d407f0b 100644 --- a/server/core/src/main/kotlin/moe/nea/ledger/server/core/api/BaseApi.kt +++ b/server/core/src/main/kotlin/moe/nea/ledger/server/core/api/BaseApi.kt @@ -21,8 +21,21 @@ fun Route.apiRouting(database: Database) { } call.respond(profiles) }.docs { + summary = "List all profiles and players known to ledger" + operationId = "listProfiles" + tag(Tags.PROFILE) respondsOk { schema>() } } } + +enum class Tags : IntoTag { + PROFILE, + MANAGEMENT, + ; + + override fun intoTag(): String { + return name + } +} \ No newline at end of file -- cgit