@Override public void serialize(InspectContainerResponse value, JsonGenerator gen, SerializerProvider provider) throws IOException { ObjectNode n = (ObjectNode) vanillaObjectMapper.convertValue(value, JsonNode.class); ObjectNode out = flatten(n); addWithPrefix(out, "config", flatten(n.path("Config"))); addWithPrefix(out, "state", flatten(n.path("State"))); gen.writeTree(out); } }
public DockerSerializerModule() { addSerializer(Container.class, new ContainerSerializer()); addSerializer(InspectContainerResponse.class, new InspectContainerResponseSerializer()); }
renameAttribute(out, "oSType", "osType"); renameAttribute(out, "iD", "id"); renameAttribute(out, "neventsListener", "nEventsListener"); renameAttribute(out, "cPUSet", "cpuSet"); renameAttribute(out, "cPUShares", "cpuShares"); renameAttribute(out, "iPv4Forwarding", "ipv4Forwarding"); renameAttribute(out, "oOMKilled", "oomKilled"); renameAttribute(out, "state_oomkilled", "state_oomKilled"); renameAttribute(out, "bridgeNfIptables", "bridgeNfIpTables"); renameAttribute(out, "bridgeNfIp6tables", "bridgeNfIp6Tables"); out.remove("ngoroutines"); return out;