File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
src/main/java/com/microsoft/aad/msal4j Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 44package com .microsoft .aad .msal4j ;
55
66import com .fasterxml .jackson .annotation .JsonInclude ;
7+ import com .fasterxml .jackson .core .JsonParser ;
78import com .fasterxml .jackson .core .JsonProcessingException ;
89import com .fasterxml .jackson .core .json .JsonReadFeature ;
910import com .fasterxml .jackson .databind .DeserializationFeature ;
1011import com .fasterxml .jackson .databind .ObjectMapper ;
12+ import com .fasterxml .jackson .databind .SerializationFeature ;
1113import com .fasterxml .jackson .databind .json .JsonMapper ;
1214
1315class 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 {
You can’t perform that action at this time.
0 commit comments