Skip to content

Commit 906df7c

Browse files
authored
Merge pull request docker-java#1091 from andrzejszywala/master
Fix No serializer found for class com.githubdockerjava.api.model.ServiceGlobalModeOptions docker-java#1090
2 parents 008c2d7 + 92a4263 commit 906df7c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/com/github/dockerjava/netty/NettyInvocationBuilder.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.fasterxml.jackson.core.JsonProcessingException;
44
import com.fasterxml.jackson.core.type.TypeReference;
55
import com.fasterxml.jackson.databind.ObjectMapper;
6+
import com.fasterxml.jackson.databind.SerializationFeature;
67
import com.github.dockerjava.api.async.ResultCallback;
78
import com.github.dockerjava.api.exception.DockerClientException;
89
import com.github.dockerjava.api.model.Frame;
@@ -343,7 +344,9 @@ private HttpRequest prepareEntityRequest(String uri, Object entity, HttpMethod h
343344

344345
byte[] bytes;
345346
try {
346-
bytes = new ObjectMapper().writeValueAsBytes(entity);
347+
ObjectMapper objectMapper = new ObjectMapper();
348+
objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
349+
bytes = objectMapper.writeValueAsBytes(entity);
347350
} catch (JsonProcessingException e) {
348351
throw new RuntimeException(e);
349352
}

0 commit comments

Comments
 (0)