diff --git a/pom.xml b/pom.xml index 11907b9..8722590 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.meituan-dianping.lyrebird.sdk lyrebird-java-client - 1.1.2 + 1.1.3 lyrebird-java-client https://github.com/Meituan-Dianping/lyrebird-java-client diff --git a/src/main/java/com/meituan/lyrebird/client/LyrebirdClient.java b/src/main/java/com/meituan/lyrebird/client/LyrebirdClient.java index a1adf2e..45840b4 100644 --- a/src/main/java/com/meituan/lyrebird/client/LyrebirdClient.java +++ b/src/main/java/com/meituan/lyrebird/client/LyrebirdClient.java @@ -1,5 +1,7 @@ package com.meituan.lyrebird.client; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; import com.meituan.lyrebird.client.api.bandwidth.Bandwidth; import com.meituan.lyrebird.client.api.bandwidth.BandwidthTemplate; import com.meituan.lyrebird.client.api.bandwidth.SpeedLimit; @@ -19,10 +21,12 @@ public class LyrebirdClient { private Socket socket; public LyrebirdClient(String lyrebirdRemoteAddress) { + ObjectMapper mapper = new ObjectMapper(); + mapper.enable(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT); Retrofit retrofit = new Retrofit .Builder() .baseUrl(lyrebirdRemoteAddress) - .addConverterFactory(JacksonConverterFactory.create()) + .addConverterFactory(JacksonConverterFactory.create(mapper)) .build(); lyrebirdService = retrofit.create(LyrebirdService.class); }