diff --git a/build.gradle.kts b/build.gradle.kts index 4d9c35a..43fb549 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -34,6 +34,7 @@ dependencies { implementation("io.ktor:ktor-server-content-negotiation") implementation("io.ktor:ktor-serialization-kotlinx-json") implementation("io.ktor:ktor-server-netty") + implementation("io.ktor:ktor-server-swagger") implementation("ch.qos.logback:logback-classic:1.5.13") implementation("com.github.bitfireAT:dav4jvm:2.2.1") implementation("io.ktor:ktor-client-logging:3.2.2") diff --git a/src/main/kotlin/Swagger.kt b/src/main/kotlin/Swagger.kt new file mode 100644 index 0000000..f1d86ca --- /dev/null +++ b/src/main/kotlin/Swagger.kt @@ -0,0 +1,13 @@ +package com.nano + +import io.ktor.server.application.Application +import io.ktor.server.plugins.swagger.swaggerUI +import io.ktor.server.routing.routing + +fun Application.configureSwagger() { + routing { + routing { + swaggerUI(path = "swagger", swaggerFile = "openapi.yaml") + } + } +} \ No newline at end of file diff --git a/openapi.yaml b/src/main/resources/openapi.yaml similarity index 100% rename from openapi.yaml rename to src/main/resources/openapi.yaml