From 022bafe9bab738e667de9db2196d2eec0d44fb5d Mon Sep 17 00:00:00 2001 From: Glenn Renfro Date: Tue, 12 Nov 2024 17:42:53 -0500 Subject: [PATCH] Replace deprecated YamlMapper configure methods to use its builder This is the recommended replacement for the deprecation Signed-off-by: Glenn Renfro --- .../domain/CloudFoundryApplicationManifestReader.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spring-cloud-skipper/spring-cloud-skipper/src/main/java/org/springframework/cloud/skipper/domain/CloudFoundryApplicationManifestReader.java b/spring-cloud-skipper/spring-cloud-skipper/src/main/java/org/springframework/cloud/skipper/domain/CloudFoundryApplicationManifestReader.java index 786e31109e..d6de0f657d 100644 --- a/spring-cloud-skipper/spring-cloud-skipper/src/main/java/org/springframework/cloud/skipper/domain/CloudFoundryApplicationManifestReader.java +++ b/spring-cloud-skipper/spring-cloud-skipper/src/main/java/org/springframework/cloud/skipper/domain/CloudFoundryApplicationManifestReader.java @@ -26,7 +26,7 @@ import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.MappingIterator; -import com.fasterxml.jackson.databind.PropertyNamingStrategy; +import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -53,10 +53,10 @@ public class CloudFoundryApplicationManifestReader implements SkipperManifestRea public List read(String manifest) { if (canSupport(manifest)) { List applicationSpecs = new ArrayList<>(); - YAMLMapper mapper = new YAMLMapper(); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - mapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true); - mapper.setPropertyNamingStrategy(PropertyNamingStrategy.KEBAB_CASE); + YAMLMapper mapper = YAMLMapper.builder(). + configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false). + configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true).build(); + mapper.setPropertyNamingStrategy(PropertyNamingStrategies.KEBAB_CASE); try { MappingIterator it = mapper .readerFor(CloudFoundryApplicationSkipperManifest.class)