Skip to content

Commit

Permalink
fix: Register kotlinmodule on objectmapper (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
ugur93 authored Nov 14, 2023
1 parent 8784879 commit 0ee63ef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/kotlin/no/nav/pdfgen/core/Environment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package no.nav.pdfgen.core

import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.kotlin.readValue
import com.fasterxml.jackson.module.kotlin.registerKotlinModule
import io.github.oshai.kotlinlogging.KotlinLogging
import no.nav.pdfgen.core.util.FontMetadata
import org.apache.pdfbox.io.IOUtils
Expand All @@ -15,7 +16,7 @@ import kotlin.io.path.extension
import kotlin.io.path.pathString
import kotlin.io.path.readBytes
private val log = KotlinLogging.logger {}
val objectMapper: ObjectMapper = ObjectMapper().findAndRegisterModules()
val objectMapper: ObjectMapper = ObjectMapper().findAndRegisterModules().registerKotlinModule()
val templateRoot: PDFGenResource = PDFGenResource("TEMPLATES_PATH", "templates/")
val imagesRoot: PDFGenResource = PDFGenResource("RESOURCES_PATH", "resources/")
val fontsRoot: PDFGenResource = PDFGenResource("FONTS_PATH", "fonts/")
Expand Down

0 comments on commit 0ee63ef

Please sign in to comment.