Skip to content

Commit 5f7d20c

Browse files
MarkEWaitebasilkrisstern
authored
Replace deprecated SNAKE_CASE with current SNAKE_CASE (#1807)
Jackson API 2.20.0 removes the PropertyNamingStrategy.SNAKE_CASE symbol. The replacement symbol is PropertyNamingStrategies.SNAKE_CASE. Refer to BOM test failures in: * jenkinsci/bom#5622 Testing done: Confirmed it compiles with Jackson 2 API 2.20.0 incremental build and with current Jackson 2 API 2.19.x. Co-authored-by: Basil Crow <[email protected]> Co-authored-by: Kris Stern <[email protected]>
1 parent dc8d35d commit 5f7d20c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main/java/com/dabsquared/gitlabjenkins/gitlab/JacksonConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import com.fasterxml.jackson.databind.DeserializationFeature;
44
import com.fasterxml.jackson.databind.ObjectMapper;
5-
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
5+
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
66
import javax.ws.rs.Consumes;
77
import javax.ws.rs.Produces;
88
import javax.ws.rs.core.MediaType;
@@ -18,7 +18,7 @@
1818
public class JacksonConfig implements ContextResolver<ObjectMapper> {
1919
public ObjectMapper getContext(Class<?> type) {
2020
return new ObjectMapper()
21-
.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE)
21+
.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE)
2222
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
2323
.configure(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_AS_NULL, true);
2424
}

src/main/java/com/dabsquared/gitlabjenkins/util/JsonUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import com.fasterxml.jackson.databind.DeserializationFeature;
55
import com.fasterxml.jackson.databind.JsonNode;
66
import com.fasterxml.jackson.databind.ObjectMapper;
7-
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
7+
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
88
import com.fasterxml.jackson.databind.SerializationFeature;
99
import com.fasterxml.jackson.databind.module.SimpleModule;
1010
import java.io.IOException;
@@ -20,7 +20,7 @@
2020
public final class JsonUtil {
2121

2222
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper()
23-
.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE)
23+
.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE)
2424
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
2525
.configure(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_AS_NULL, true)
2626
.configure(SerializationFeature.INDENT_OUTPUT, true)

0 commit comments

Comments
 (0)