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.DecoderHttpMessageReader
import org.springframework.http.codec.EncoderHttpMessageWriter
import org.springframework.http.codec.json.Jackson2JsonDecoder
import org.springframework.http.codec.json.Jackson2JsonEncoder

class Jackson2JsonCodecCustomizer : CodecCustomizer {
    override fun customize(configurer: CodecConfigurer) {
        configurer.customCodecs().register(EncoderHttpMessageWriter(Jackson2JsonEncoder(Json.mapper)))
        configurer.customCodecs().register(DecoderHttpMessageReader(Jackson2JsonDecoder(Json.mapper)))
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy