Skip to content

Commit 2a2a4c8

Browse files
committed
Stop using Jacksons deprecated serializationInclusion
Use the recommended `defaultPropertyInclusion` instead.
1 parent d7f7355 commit 2a2a4c8

File tree

1 file changed

+5
-1
lines changed
  • cucumber-core/src/main/java/io/cucumber/core/plugin

1 file changed

+5
-1
lines changed

cucumber-core/src/main/java/io/cucumber/core/plugin/Jackson.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@
99
import com.fasterxml.jackson.databind.json.JsonMapper;
1010
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
1111

12+
import static com.fasterxml.jackson.annotation.JsonInclude.Value.construct;
13+
1214
final class Jackson {
1315
public static final ObjectMapper OBJECT_MAPPER = JsonMapper.builder()
1416
.addModule(new Jdk8Module())
15-
.serializationInclusion(Include.NON_ABSENT)
17+
.defaultPropertyInclusion(construct(
18+
Include.NON_ABSENT,
19+
Include.NON_ABSENT))
1620
.constructorDetector(ConstructorDetector.USE_PROPERTIES_BASED)
1721
.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING)
1822
.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING)

0 commit comments

Comments
 (0)