Skip to content

Commit

Permalink
Merge pull request #20 from yury-awesome/bugfix/empty-json-error
Browse files Browse the repository at this point in the history
Fix: no String-argument constructor/factory method to deserialize from String value ('')
  • Loading branch information
yury-awesome authored Apr 22, 2020
2 parents 8811806 + 38ab98f commit a40ae14
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.github.meituan-dianping.lyrebird.sdk</groupId>
<artifactId>lyrebird-java-client</artifactId>
<version>1.1.2</version>
<version>1.1.3</version>

<name>lyrebird-java-client</name>
<url>https://github.com/Meituan-Dianping/lyrebird-java-client</url>
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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);
}
Expand Down

0 comments on commit a40ae14

Please sign in to comment.