File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
src/main/java/org/sourcelab/kafka/connect/apiclient/request Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 2020import com .fasterxml .jackson .databind .DeserializationFeature ;
2121import com .fasterxml .jackson .databind .ObjectMapper ;
2222import com .fasterxml .jackson .databind .PropertyNamingStrategy ;
23+ import com .fasterxml .jackson .databind .type .MapType ;
24+
25+ import java .util .Map ;
2326
2427/**
2528 * Creates properly configured Jackson XML Mapper instances.
@@ -32,6 +35,12 @@ public final class JacksonFactory {
3235 */
3336 private static final ObjectMapper mapper = new ObjectMapper ();
3437
38+ /**
39+ * Defines a "type safe" Map[String, String] deserialization type for Jackson.
40+ */
41+ public static final MapType mapTypeStringString = mapper .getTypeFactory ()
42+ .constructMapType (Map .class , String .class , String .class );
43+
3544 /*
3645 * Statically configure the instance.
3746 */
Original file line number Diff line number Diff line change @@ -53,6 +53,6 @@ public Object getRequestBody() {
5353
5454 @ Override
5555 public Map <String , String > parseResponse (final String responseStr ) throws IOException {
56- return JacksonFactory .newInstance ().readValue (responseStr , Map . class );
56+ return JacksonFactory .newInstance ().readValue (responseStr , JacksonFactory . mapTypeStringString );
5757 }
5858}
You can’t perform that action at this time.
0 commit comments