Skip to content

Commit

Permalink
Replace deprecated YamlMapper configure methods to use its builder
Browse files Browse the repository at this point in the history
This is the recommended replacement for the deprecation

Signed-off-by: Glenn Renfro <[email protected]>
  • Loading branch information
cppwfs committed Nov 12, 2024
1 parent 5a5c017 commit 022bafe
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).build();
mapper.setPropertyNamingStrategy(PropertyNamingStrategies.KEBAB_CASE);
try {
MappingIterator<CloudFoundryApplicationSkipperManifest> it = mapper
.readerFor(CloudFoundryApplicationSkipperManifest.class)
Expand Down

0 comments on commit 022bafe

Please sign in to comment.