BAEL-7272: Removed CodeCustomizer config which is not mandatory for Global serialization/deserialization config

This commit is contained in:
balasr3 2024-02-24 16:52:26 +00:00
parent 7727131cf7
commit e50e8e96a0
1 changed files with 0 additions and 27 deletions

View File

@ -1,27 +0,0 @@
package com.baeldung.custom.deserialization.config;
import org.springframework.boot.web.codec.CodecCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType;
import org.springframework.http.codec.CodecConfigurer;
import org.springframework.http.codec.json.Jackson2JsonDecoder;
import org.springframework.http.codec.json.Jackson2JsonEncoder;
import org.springframework.util.MimeType;
import com.fasterxml.jackson.databind.ObjectMapper;
@Configuration
public class CodecCustomizerConfig {
@Bean
public CodecCustomizer codecCustomizer(ObjectMapper customObjectMapper) {
return configurer -> {
MimeType mimeType = MimeType.valueOf(MediaType.APPLICATION_JSON_VALUE);
CodecConfigurer.CustomCodecs customCodecs = configurer.customCodecs();
customCodecs.register(new Jackson2JsonDecoder(customObjectMapper, mimeType));
customCodecs.register(new Jackson2JsonEncoder(customObjectMapper, mimeType));
};
}
}