aboutsummaryrefslogtreecommitdiff
path: root/server/core
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2025-01-17 13:40:43 +0100
committerLinnea Gräf <nea@nea.moe>2025-01-17 13:40:43 +0100
commite08c8778640967cc086a922f178b18e08b313a29 (patch)
treec328988177e5a061218bc0df69498264eea1ae46 /server/core
parentce6e008426c30cba493832d0866950c59f7c31c1 (diff)
downloadLocalTransactionLedger-e08c8778640967cc086a922f178b18e08b313a29.tar.gz
LocalTransactionLedger-e08c8778640967cc086a922f178b18e08b313a29.tar.bz2
LocalTransactionLedger-e08c8778640967cc086a922f178b18e08b313a29.zip
feat(server): Bundle swagger ui
Diffstat (limited to 'server/core')
-rw-r--r--server/core/src/main/kotlin/moe/nea/ledger/server/core/Application.kt4
-rw-r--r--server/core/src/main/kotlin/moe/nea/ledger/server/core/api/BaseApi.kt13
2 files changed, 17 insertions, 0 deletions
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<String>) {
@@ -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<List<Profile>>()
}
}
}
+
+enum class Tags : IntoTag {
+ PROFILE,
+ MANAGEMENT,
+ ;
+
+ override fun intoTag(): String {
+ return name
+ }
+} \ No newline at end of file