Skip to content

Commit 8a6d45c

Browse files
laeubiCopilot
andauthored
Add ParameterNamesModule to Jackson mapper with proper shading (#3136)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent fbccbdf commit 8a6d45c

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

cucumber-core/pom.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@
138138
<groupId>com.fasterxml.jackson.datatype</groupId>
139139
<artifactId>jackson-datatype-jdk8</artifactId>
140140
</dependency>
141+
<dependency>
142+
<groupId>com.fasterxml.jackson.module</groupId>
143+
<artifactId>jackson-module-parameter-names</artifactId>
144+
</dependency>
141145

142146
<dependency>
143147
<groupId>org.xmlunit</groupId>
@@ -279,6 +283,7 @@
279283
<include>com.fasterxml.jackson.core:jackson-core</include>
280284
<include>com.fasterxml.jackson.core:jackson-annotations</include>
281285
<include>com.fasterxml.jackson.datatype:jackson-datatype-jdk8</include>
286+
<include>com.fasterxml.jackson.module:jackson-module-parameter-names</include>
282287
</includes>
283288
</artifactSet>
284289
<relocations>
@@ -322,6 +327,14 @@
322327
<exclude>META-INF/services/**</exclude>
323328
</excludes>
324329
</filter>
330+
<filter>
331+
<artifact>com.fasterxml.jackson.module:jackson-module-parameter-names</artifact>
332+
<excludes>
333+
<exclude>**/module-info.class</exclude>
334+
<exclude>META-INF/MANIFEST.MF</exclude>
335+
<exclude>META-INF/services/**</exclude>
336+
</excludes>
337+
</filter>
325338
</filters>
326339
</configuration>
327340
</execution>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package io.cucumber.core.plugin;
22

3+
import com.fasterxml.jackson.annotation.JsonCreator.Mode;
34
import com.fasterxml.jackson.annotation.JsonInclude.Include;
45
import com.fasterxml.jackson.core.JsonGenerator;
56
import com.fasterxml.jackson.databind.DeserializationFeature;
@@ -8,12 +9,14 @@
89
import com.fasterxml.jackson.databind.cfg.ConstructorDetector;
910
import com.fasterxml.jackson.databind.json.JsonMapper;
1011
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
12+
import com.fasterxml.jackson.module.paramnames.ParameterNamesModule;
1113

1214
import static com.fasterxml.jackson.annotation.JsonInclude.Value.construct;
1315

1416
final class Jackson {
1517
public static final ObjectMapper OBJECT_MAPPER = JsonMapper.builder()
1618
.addModule(new Jdk8Module())
19+
.addModule(new ParameterNamesModule(Mode.PROPERTIES))
1720
.defaultPropertyInclusion(construct(
1821
Include.NON_ABSENT,
1922
Include.NON_ABSENT))

0 commit comments

Comments
 (0)