Skip to content

Commit cb6d652

Browse files
author
Federico Grilli
committed
gitlab4j#1280 Use PropertyNamingStrategies instead of PropertyNamingStrategy
* the latter was deprecated as of 2.12 and removed in jackson-databind 2.20
1 parent 329752b commit cb6d652

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/main/java/org/gitlab4j/api/utils/JacksonJson.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import com.fasterxml.jackson.databind.JsonSerializer;
3434
import com.fasterxml.jackson.databind.ObjectMapper;
3535
import com.fasterxml.jackson.databind.ObjectWriter;
36-
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
36+
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
3737
import com.fasterxml.jackson.databind.SerializationFeature;
3838
import com.fasterxml.jackson.databind.SerializerProvider;
3939
import com.fasterxml.jackson.databind.module.SimpleModule;
@@ -59,7 +59,7 @@ public JacksonJson() {
5959
objectMapper = new ObjectMapper();
6060

6161
objectMapper.setSerializationInclusion(Include.NON_NULL);
62-
objectMapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE);
62+
objectMapper.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE);
6363

6464
objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
6565
objectMapper.configure(SerializationFeature.WRITE_ENUMS_USING_TO_STRING, true);
@@ -81,7 +81,7 @@ public ObjectMapper getContext(Class<?> objectType) {
8181

8282
/**
8383
* Gets the ObjectMapper contained by this instance.
84-
*
84+
*
8585
* @return the ObjectMapper contained by this instance
8686
*/
8787
public ObjectMapper getObjectMapper() {
@@ -230,7 +230,7 @@ public <T> Map<String, T> unmarshalMap(Class<T> returnType, String jsonData) thr
230230

231231
/**
232232
* Marshals the supplied object out as a formatted JSON string.
233-
*
233+
*
234234
* @param <T> the generics type for the provided object
235235
* @param object the object to output as a JSON string
236236
* @return a String containing the JSON for the specified object
@@ -349,7 +349,7 @@ public List<User> deserialize(JsonParser jsonParser, DeserializationContext cont
349349
private static class JacksonJsonSingletonHelper {
350350
private static final JacksonJson JACKSON_JSON = new JacksonJson();
351351
static {
352-
JACKSON_JSON.objectMapper.setPropertyNamingStrategy(PropertyNamingStrategy.LOWER_CAMEL_CASE);
352+
JACKSON_JSON.objectMapper.setPropertyNamingStrategy(PropertyNamingStrategies.LOWER_CAMEL_CASE);
353353
JACKSON_JSON.objectMapper.setSerializationInclusion(Include.ALWAYS);
354354
}
355355
}

0 commit comments

Comments
 (0)