Do not render empty children list

This looks awkward for files.
This commit is contained in:
René Pfeuffer
2018-10-16 14:52:01 +02:00
parent 7845443d62
commit 2e283ef4b8

View File

@@ -32,6 +32,9 @@ public class FileObjectDto extends HalRepresentation {
}
public void setChildren(List<FileObjectDto> children) {
this.withEmbedded("children", children);
if (!children.isEmpty()) {
// prevent empty embedded attribute in json
this.withEmbedded("children", children);
}
}
}