All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bybutter.sisyphus.starter.jackson.json.Jackson2JsonCodecCustomizer.kt Maven / Gradle / Ivy

There is a newer version: 2.1.22
Show newest version
package com.bybutter.sisyphus.starter.jackson.json

import com.bybutter.sisyphus.jackson.Json
import org.springframework.boot.web.codec.CodecCustomizer
import org.springframework.http.codec.CodecConfigurer
import org.springframework.http.codec.json.Jackson2JsonDecoder
import org.springframework.http.codec.json.Jackson2JsonEncoder

class Jackson2JsonCodecCustomizer : CodecCustomizer {
    override fun customize(configurer: CodecConfigurer) {
        configurer.defaultCodecs().jackson2JsonEncoder(Jackson2JsonEncoder(Json.mapper))
        configurer.defaultCodecs().jackson2JsonDecoder(
            Jackson2JsonDecoder(Json.mapper).apply {
                this.maxInMemorySize = 4 * 1024 * 1024
            }
        )
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy