Skip to content

Commit a2e0314

Browse files
authored
jackson config switch to older api (#160)
1 parent 43d727b commit a2e0314

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/main/java/com/microsoft/aad/msal4j/JsonHelper.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,23 @@
44
package com.microsoft.aad.msal4j;
55

66
import com.fasterxml.jackson.annotation.JsonInclude;
7+
import com.fasterxml.jackson.core.JsonParser;
78
import com.fasterxml.jackson.core.JsonProcessingException;
89
import com.fasterxml.jackson.core.json.JsonReadFeature;
910
import com.fasterxml.jackson.databind.DeserializationFeature;
1011
import com.fasterxml.jackson.databind.ObjectMapper;
12+
import com.fasterxml.jackson.databind.SerializationFeature;
1113
import com.fasterxml.jackson.databind.json.JsonMapper;
1214

1315
class JsonHelper {
16+
static ObjectMapper mapper;
1417

15-
static ObjectMapper mapper = JsonMapper.builder()
16-
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
17-
.configure(JsonReadFeature.ALLOW_UNESCAPED_CONTROL_CHARS, true)
18-
.serializationInclusion(JsonInclude.Include.NON_NULL)
19-
.build();
18+
static {
19+
mapper = new ObjectMapper();
20+
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
21+
mapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_CONTROL_CHARS, true);
22+
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
23+
}
2024

2125
static <T> T convertJsonToObject(final String json, final Class<T> clazz) {
2226
try {

0 commit comments

Comments
 (0)