From 07166df9a6fe37df1a62ef4a715ccc2e8119047a Mon Sep 17 00:00:00 2001 From: Glenn Renfro Date: Wed, 13 Nov 2024 12:18:43 -0500 Subject: [PATCH] Replace deprecated YamlMapper configure w/ builder Replaces the deprecated YamlMapper configure methods w/ its builder.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..2643e2cf48 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). + propertyNamingStrategy(PropertyNamingStrategies.KEBAB_CASE).build(); try { MappingIterator it = mapper .readerFor(CloudFoundryApplicationSkipperManifest.class)