Skip to content
Snippets Groups Projects
Commit 5693d93c authored by Ronald Li's avatar Ronald Li
Browse files

Make null values not show up in the rest output

parent 8dc731c2
No related branches found
No related tags found
No related merge requests found
......@@ -64,7 +64,10 @@ public class DeviceSerializer extends JsonSerializer<Device> {
jGen.writeNumberField("lastSeen", device.getLastSeen().getTime());
jGen.writeStringField("dhcpClientName", device.getDHCPClientName());
String dhcpClientName = device.getDHCPClientName();
if (dhcpClientName != null) {
jGen.writeStringField("dhcpClientName", dhcpClientName);
}
jGen.writeEndObject();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment