Skip to content

Commit 43e0207

Browse files
committed
Logger request body i SF oppdatering i forbindelse med feilsøking i kall fra OeBS
1 parent 719a1b1 commit 43e0207

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/kotlin/no/nav/hjelpemidler/oebs/listener/api/ServiceforespørselAPI.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package no.nav.hjelpemidler.oebs.listener.api
22

33
import com.fasterxml.jackson.annotation.JsonProperty
4+
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
45
import io.github.oshai.kotlinlogging.KotlinLogging
56
import io.ktor.http.HttpStatusCode
67
import io.ktor.server.application.call
7-
import io.ktor.server.request.receive
8+
import io.ktor.server.request.receiveText
89
import io.ktor.server.response.respond
910
import io.ktor.server.routing.Route
1011
import io.ktor.server.routing.post
@@ -18,7 +19,11 @@ fun Route.serviceforespørselAPI(context: Context) {
1819
post("/sf") {
1920
log.info { "Innkommende SF-oppdatering" }
2021
try {
21-
val endring = call.receive<ServiceforespørselEndring>()
22+
val requestBody = call.receiveText()
23+
log.info { "Request body i SF oppdatering: $requestBody" }
24+
val endring = jacksonObjectMapper().readValue(requestBody, ServiceforespørselEndring::class.java)
25+
log.info { "Endring: $endring" }
26+
// val endring = call.receive<ServiceforespørselEndring>()
2227
val message = ServiceforespørselEndringMessage(endring)
2328
publiserMelding(context, endring, message)
2429
call.respond(HttpStatusCode.OK)

0 commit comments

Comments
 (0)