Skip to content

Commit d036c84

Browse files
committed
Oppgrader til ktor 3
1 parent a1e1e53 commit d036c84

File tree

4 files changed

+17
-13
lines changed

4 files changed

+17
-13
lines changed

build.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@ import com.expediagroup.graphql.plugin.gradle.tasks.GraphQLGenerateClientTask
55
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
66
import com.github.jengelman.gradle.plugins.shadow.transformers.ServiceFileTransformer
77

8-
val ktor_version = "2.3.12"
8+
val ktor_version = "3.0.1"
99
val kotlin_version = "2.0.21"
1010
val kotlinx_datetime_version = "0.6.1"
11-
val kompendium_version = "3.14.4"
11+
val kompendium_version = "4.0.1"
1212
val logback_version = "1.5.12"
1313
val logstash_version = "8.0"
1414
val prometeus_version = "1.6.3"
1515
val nav_common_version = "3.2024.10.25_13.44-9db48a0dbe67"
1616
val tjenestespec_version = "1.2021.02.22-10.45-4201aaea72fb"
17-
val modia_common_utils_version = "1.2023.07.20-13.43-64707e48b53b"
17+
val modia_common_utils_version = "1.2024.10.30-08.17-f565fe211cd4"
1818
val junit_version = "5.11.3"
1919
val graphql_kotlin_version = "8.2.1"
2020

2121
plugins {
2222
application
2323
kotlin("jvm") version "2.0.21"
2424
id("org.jetbrains.kotlin.plugin.serialization") version "2.0.21"
25-
id("com.github.johnrengelman.shadow") version "8.1.1"
25+
id("com.gradleup.shadow") version "8.3.4"
2626
id("com.expediagroup.graphql") version "8.2.1"
2727
}
2828

src/main/kotlin/no/nav/api/debug/DebugRoutes.kt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package no.nav.api.debug
22

33
import io.bkbn.kompendium.core.metadata.PostInfo
44
import io.bkbn.kompendium.core.plugin.NotarizedRoute
5+
import io.bkbn.kompendium.oas.payload.MediaType
56
import io.ktor.http.*
67
import io.ktor.server.application.*
78
import io.ktor.server.request.*
@@ -62,11 +63,13 @@ private object Api {
6263
examples(
6364
Pair(
6465
"example",
65-
TokenExchangeRequest(
66-
cluster = "dev-fss",
67-
namespace = "teamname",
68-
application = "app-api",
69-
),
66+
MediaType.Example(
67+
TokenExchangeRequest(
68+
cluster = "dev-fss",
69+
namespace = "teamname",
70+
application = "app-api",
71+
),
72+
)
7073
),
7174
)
7275
}

src/main/kotlin/no/nav/plugins/Monitoring.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import io.ktor.http.*
44
import io.ktor.server.application.*
55
import io.ktor.server.plugins.*
66
import io.ktor.server.plugins.callid.*
7-
import io.ktor.server.plugins.callloging.*
7+
import io.ktor.server.plugins.calllogging.*
88
import io.ktor.server.request.*
99
import io.ktor.server.response.*
1010
import io.ktor.server.routing.*

src/main/kotlin/no/nav/plugins/OpenApi.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ private val specSerializer =
3232

3333
fun Application.configureOpenApi() {
3434
install(NotarizedApplication()) {
35-
spec =
35+
spec = {
3636
OpenApiSpec(
3737
info =
3838
Info(
@@ -47,9 +47,10 @@ fun Application.configureOpenApi() {
4747
),
4848
),
4949
)
50+
}
5051

51-
openApiJson = {
52-
route("/openapi.json") {
52+
specRoute = { spec, routing ->
53+
routing.route("/openapi.json") {
5354
get {
5455
call.respondText(
5556
contentType = ContentType.Application.Json,

0 commit comments

Comments
 (0)