package de.krisenvorrat.server.plugins

import io.ktor.http.*
import io.ktor.serialization.kotlinx.json.*
import io.ktor.server.application.*
import io.ktor.server.plugins.contentnegotiation.*
import kotlinx.serialization.json.Json

internal fun Application.configureSerialization() {
    install(ContentNegotiation) {
        json(
            json = Json {
                prettyPrint = true
                isLenient = false
                ignoreUnknownKeys = true
            },
            contentType = ContentType.Application.Json.withCharset(Charsets.UTF_8)
        )
    }
}
