Merge pull request #15997 from balasr21/master
BAEL-7628: Removed CodecCustomerizer for global config as its not required
This commit is contained in:
commit
a53feeeed3
@ -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));
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user