Merge pull request #15997 from balasr21/master

BAEL-7628: Removed CodecCustomerizer for global config as its not required
This commit is contained in:
davidmartinezbarua 2024-03-31 10:40:26 -03:00 committed by GitHub
commit a53feeeed3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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));
};
}
}