Skip to content

Commit

Permalink
Replace deprecated YamlMapper configure w/ builder
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
cppwfs authored Nov 13, 2024
1 parent 694f0ef commit 07166df
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -53,10 +53,10 @@ public class CloudFoundryApplicationManifestReader implements SkipperManifestRea
public List<CloudFoundryApplicationSkipperManifest> read(String manifest) {
if (canSupport(manifest)) {
List<CloudFoundryApplicationSkipperManifest> 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<CloudFoundryApplicationSkipperManifest> it = mapper
.readerFor(CloudFoundryApplicationSkipperManifest.class)
Expand Down

0 comments on commit 07166df

Please sign in to comment.