Remove deprecated property
This commit is contained in:
@@ -85,9 +85,6 @@ import org.springframework.util.StringUtils;
|
|||||||
@AutoConfigureAfter(name = {"org.springframework.cloud.function.deployer.FunctionDeployerConfiguration"})
|
@AutoConfigureAfter(name = {"org.springframework.cloud.function.deployer.FunctionDeployerConfiguration"})
|
||||||
public class ContextFunctionCatalogAutoConfiguration {
|
public class ContextFunctionCatalogAutoConfiguration {
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
static final String PREFERRED_MAPPER_PROPERTY = "spring.http.converters.preferred-json-mapper";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the property to specify desired JSON mapper. Available values are `jackson' and 'gson'.
|
* The name of the property to specify desired JSON mapper. Available values are `jackson' and 'gson'.
|
||||||
*/
|
*/
|
||||||
@@ -194,9 +191,7 @@ public class ContextFunctionCatalogAutoConfiguration {
|
|||||||
public static class JsonMapperConfiguration {
|
public static class JsonMapperConfiguration {
|
||||||
@Bean
|
@Bean
|
||||||
public JsonMapper jsonMapper(ApplicationContext context) {
|
public JsonMapper jsonMapper(ApplicationContext context) {
|
||||||
String preferredMapper = context.getEnvironment().containsProperty(JSON_MAPPER_PROPERTY)
|
String preferredMapper = context.getEnvironment().getProperty(JSON_MAPPER_PROPERTY);
|
||||||
? context.getEnvironment().getProperty(JSON_MAPPER_PROPERTY)
|
|
||||||
: context.getEnvironment().getProperty(PREFERRED_MAPPER_PROPERTY);
|
|
||||||
if (StringUtils.hasText(preferredMapper)) {
|
if (StringUtils.hasText(preferredMapper)) {
|
||||||
if ("gson".equals(preferredMapper) && ClassUtils.isPresent("com.google.gson.Gson", null)) {
|
if ("gson".equals(preferredMapper) && ClassUtils.isPresent("com.google.gson.Gson", null)) {
|
||||||
return gson(context);
|
return gson(context);
|
||||||
|
|||||||
@@ -134,11 +134,8 @@ public class ContextFunctionCatalogInitializer implements ApplicationContextInit
|
|||||||
}
|
}
|
||||||
ConfigurationPropertiesBindingPostProcessor.register(registry);
|
ConfigurationPropertiesBindingPostProcessor.register(registry);
|
||||||
|
|
||||||
String preferredMapper = context.getEnvironment().containsProperty(ContextFunctionCatalogAutoConfiguration.JSON_MAPPER_PROPERTY)
|
String preferredMapper = context.getEnvironment().getProperty(ContextFunctionCatalogAutoConfiguration.JSON_MAPPER_PROPERTY);
|
||||||
? context.getEnvironment().getProperty(ContextFunctionCatalogAutoConfiguration.JSON_MAPPER_PROPERTY)
|
|
||||||
: context.getEnvironment().getProperty(ContextFunctionCatalogAutoConfiguration.PREFERRED_MAPPER_PROPERTY);
|
|
||||||
|
|
||||||
|
|
||||||
if (ClassUtils.isPresent("com.google.gson.Gson", null) && "gson".equals(preferredMapper)) {
|
if (ClassUtils.isPresent("com.google.gson.Gson", null) && "gson".equals(preferredMapper)) {
|
||||||
if (this.context.getBeanFactory().getBeanNamesForType(Gson.class, false, false).length == 0) {
|
if (this.context.getBeanFactory().getBeanNamesForType(Gson.class, false, false).length == 0) {
|
||||||
this.context.registerBean(Gson.class, () -> new Gson());
|
this.context.registerBean(Gson.class, () -> new Gson());
|
||||||
|
|||||||
Reference in New Issue
Block a user