From a352c8be4b5b8fae28850a44652622f7d8414501 Mon Sep 17 00:00:00 2001 From: Lukas Ruegner Date: Sat, 11 Nov 2023 14:06:28 +0100 Subject: [PATCH] upgrade versions of dependencies --- build.gradle.kts | 22 ++++++++-------- .../smiley4/ktorswaggerui/SwaggerPlugin.kt | 2 +- .../data/SwaggerUiSyntaxHighlight.kt | 3 ++- .../ktorswaggerui/routing/ResourceContent.kt | 2 +- .../ktorswaggerui/tests/ApplicationTests.kt | 26 +++++++++---------- 5 files changed, 28 insertions(+), 27 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 63032ed6..90398f0d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -33,7 +33,7 @@ repositories { dependencies { - val ktorVersion = "2.3.3" + val ktorVersion = "2.3.6" implementation("io.ktor:ktor-server-core-jvm:$ktorVersion") implementation("io.ktor:ktor-server-webjars:$ktorVersion") implementation("io.ktor:ktor-server-auth:$ktorVersion") @@ -45,10 +45,10 @@ dependencies { testImplementation("io.ktor:ktor-server-call-logging:$ktorVersion") testImplementation("io.ktor:ktor-server-test-host:$ktorVersion") - val swaggerUiVersion = "4.15.0" // this version must match the version declared in the code (SwaggerPlugin#SWAGGER_UI_WEBJARS_VERSION) + val swaggerUiVersion = "5.9.0" // this version must match the version declared in the code (SwaggerPlugin#SWAGGER_UI_WEBJARS_VERSION) implementation("org.webjars:swagger-ui:$swaggerUiVersion") - val swaggerParserVersion = "2.1.13" + val swaggerParserVersion = "2.1.18" implementation("io.swagger.parser.v3:swagger-parser:$swaggerParserVersion") val jsonSchemaGeneratorVersion = "4.32.0" @@ -56,28 +56,28 @@ dependencies { implementation("com.github.victools:jsonschema-module-jackson:$jsonSchemaGeneratorVersion") implementation("com.github.victools:jsonschema-module-swagger-2:$jsonSchemaGeneratorVersion") - val jacksonVersion = "2.14.2" + val jacksonVersion = "2.15.3" implementation("com.fasterxml.jackson.module:jackson-module-kotlin:${jacksonVersion}") - val kotlinLoggingVersion = "2.1.23" + val kotlinLoggingVersion = "3.0.5" implementation("io.github.microutils:kotlin-logging-jvm:$kotlinLoggingVersion") - val logbackVersion = "1.4.5" + val logbackVersion = "1.4.11" testImplementation("ch.qos.logback:logback-classic:$logbackVersion") - val versionMockk = "1.12.7" + val versionMockk = "1.13.8" testImplementation("io.mockk:mockk:$versionMockk") - val versionKotest = "5.7.2" + val versionKotest = "5.8.0" testImplementation("io.kotest:kotest-runner-junit5:$versionKotest") testImplementation("io.kotest:kotest-assertions-core:$versionKotest") - val versionKotlinTest = "1.7.21" + val versionKotlinTest = "1.8.21" testImplementation("org.jetbrains.kotlin:kotlin-test:$versionKotlinTest") - testImplementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1") + testImplementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0") testImplementation("com.github.Ricky12Awesome:json-schema-serialization:0.9.9") - testImplementation("org.jetbrains.kotlinx:kotlinx-datetime:0.4.0") + testImplementation("org.jetbrains.kotlinx:kotlinx-datetime:0.4.1") } kotlin { diff --git a/src/main/kotlin/io/github/smiley4/ktorswaggerui/SwaggerPlugin.kt b/src/main/kotlin/io/github/smiley4/ktorswaggerui/SwaggerPlugin.kt index 372f874c..e111b085 100644 --- a/src/main/kotlin/io/github/smiley4/ktorswaggerui/SwaggerPlugin.kt +++ b/src/main/kotlin/io/github/smiley4/ktorswaggerui/SwaggerPlugin.kt @@ -52,7 +52,7 @@ import mu.KotlinLogging /** * This version must match the version of the gradle dependency */ -internal const val SWAGGER_UI_WEBJARS_VERSION = "4.15.0" +internal const val SWAGGER_UI_WEBJARS_VERSION = "5.9.0" private val logger = KotlinLogging.logger {} diff --git a/src/main/kotlin/io/github/smiley4/ktorswaggerui/data/SwaggerUiSyntaxHighlight.kt b/src/main/kotlin/io/github/smiley4/ktorswaggerui/data/SwaggerUiSyntaxHighlight.kt index 749adf29..3d38d957 100644 --- a/src/main/kotlin/io/github/smiley4/ktorswaggerui/data/SwaggerUiSyntaxHighlight.kt +++ b/src/main/kotlin/io/github/smiley4/ktorswaggerui/data/SwaggerUiSyntaxHighlight.kt @@ -6,5 +6,6 @@ enum class SwaggerUiSyntaxHighlight(val value: String) { MONOKAI("monokai"), NORD("nord"), OBSIDIAN("obsidian"), - TOMORROW_NIGHT("tomorrow-night") + TOMORROW_NIGHT("tomorrow-night"), + IDEA("idea") } diff --git a/src/main/kotlin/io/github/smiley4/ktorswaggerui/routing/ResourceContent.kt b/src/main/kotlin/io/github/smiley4/ktorswaggerui/routing/ResourceContent.kt index 9523187a..81d63f1d 100644 --- a/src/main/kotlin/io/github/smiley4/ktorswaggerui/routing/ResourceContent.kt +++ b/src/main/kotlin/io/github/smiley4/ktorswaggerui/routing/ResourceContent.kt @@ -11,7 +11,7 @@ class ResourceContent(private val resource: URL) : OutgoingContent.ByteArrayCont "html" to ContentType.Text.Html, "css" to ContentType.Text.CSS, "js" to ContentType.Application.JavaScript, - "json" to ContentType.Application.Json.withCharset(Charsets.UTF_8), + "json" to ContentType.Application.Json, "png" to ContentType.Image.PNG ) diff --git a/src/test/kotlin/io/github/smiley4/ktorswaggerui/tests/ApplicationTests.kt b/src/test/kotlin/io/github/smiley4/ktorswaggerui/tests/ApplicationTests.kt index e9c7fe79..9ab604be 100644 --- a/src/test/kotlin/io/github/smiley4/ktorswaggerui/tests/ApplicationTests.kt +++ b/src/test/kotlin/io/github/smiley4/ktorswaggerui/tests/ApplicationTests.kt @@ -46,12 +46,12 @@ class ApplicationTests { } get("/swagger-ui/swagger-initializer.js").also { it.status shouldBe HttpStatusCode.OK - it.contentType shouldBe ContentType.Application.JavaScript.withCharset(Charsets.UTF_8) + it.contentType shouldBe ContentType.Application.JavaScript it.body shouldContain "url: \"/swagger-ui/api.json\"" } get("/swagger-ui/api.json").also { it.status shouldBe HttpStatusCode.OK - it.contentType shouldBe ContentType.Application.Json.withCharset(Charsets.UTF_8) + it.contentType shouldBe ContentType.Application.Json it.body.shouldNotBeEmpty() } } @@ -82,13 +82,13 @@ class ApplicationTests { } get("my-root/swagger-ui/swagger-initializer.js").also { it.status shouldBe HttpStatusCode.OK - it.contentType shouldBe ContentType.Application.JavaScript.withCharset(Charsets.UTF_8) + it.contentType shouldBe ContentType.Application.JavaScript it.body shouldContain "url: \"/my-root/swagger-ui/api.json\"" } get("my-root/swagger-ui/api.json").also { it.status shouldBe HttpStatusCode.OK - it.contentType shouldBe ContentType.Application.Json.withCharset(Charsets.UTF_8) + it.contentType shouldBe ContentType.Application.Json it.body.shouldNotBeEmpty() } } @@ -121,12 +121,12 @@ class ApplicationTests { } get("/swagger-ui/swagger-initializer.js").also { it.status shouldBe HttpStatusCode.OK - it.contentType shouldBe ContentType.Application.JavaScript.withCharset(Charsets.UTF_8) + it.contentType shouldBe ContentType.Application.JavaScript it.body shouldContain "url: \"/swagger-ui/api.json\"" } get("/swagger-ui/api.json").also { it.status shouldBe HttpStatusCode.OK - it.contentType shouldBe ContentType.Application.Json.withCharset(Charsets.UTF_8) + it.contentType shouldBe ContentType.Application.Json it.body.shouldNotBeEmpty() } } @@ -251,13 +251,13 @@ class ApplicationTests { } get("/test-swagger/swagger-initializer.js").also { it.status shouldBe HttpStatusCode.OK - it.contentType shouldBe ContentType.Application.JavaScript.withCharset(Charsets.UTF_8) + it.contentType shouldBe ContentType.Application.JavaScript it.body shouldContain "url: \"/test-swagger/api.json\"" } get("/test-swagger/api.json").also { it.status shouldBe HttpStatusCode.OK - it.contentType shouldBe ContentType.Application.Json.withCharset(Charsets.UTF_8) + it.contentType shouldBe ContentType.Application.Json it.body.shouldNotBeEmpty() } } @@ -327,12 +327,12 @@ class ApplicationTests { } get("/swagger-ui/hello/swagger-initializer.js").also { it.status shouldBe HttpStatusCode.OK - it.contentType shouldBe ContentType.Application.JavaScript.withCharset(Charsets.UTF_8) + it.contentType shouldBe ContentType.Application.JavaScript it.body shouldContain "url: \"/swagger-ui/hello/hello.json\"" } get("/swagger-ui/hello/hello.json").also { it.status shouldBe HttpStatusCode.OK - it.contentType shouldBe ContentType.Application.Json.withCharset(Charsets.UTF_8) + it.contentType shouldBe ContentType.Application.Json it.body.shouldNotBeEmpty() } get("/swagger-ui/world").also { @@ -347,12 +347,12 @@ class ApplicationTests { } get("/swagger-ui/world/swagger-initializer.js").also { it.status shouldBe HttpStatusCode.OK - it.contentType shouldBe ContentType.Application.JavaScript.withCharset(Charsets.UTF_8) + it.contentType shouldBe ContentType.Application.JavaScript it.body shouldContain "url: \"/swagger-ui/world/world.json\"" } get("/swagger-ui/world/world.json").also { it.status shouldBe HttpStatusCode.OK - it.contentType shouldBe ContentType.Application.Json.withCharset(Charsets.UTF_8) + it.contentType shouldBe ContentType.Application.Json it.body.shouldNotBeEmpty() } } @@ -379,7 +379,7 @@ class ApplicationTests { } get("/swagger-ui/hello/hello.json").also { it.status shouldBe HttpStatusCode.OK - it.contentType shouldBe ContentType.Application.Json.withCharset(Charsets.UTF_8) + it.contentType shouldBe ContentType.Application.Json it.body.shouldNotBeEmpty() } get("/swagger-ui/world/index.html").also {