diff --git a/metacat-functional-tests/src/functionalTest/groovy/com/netflix/metacat/MetacatFunctionalSpec.groovy b/metacat-functional-tests/src/functionalTest/groovy/com/netflix/metacat/MetacatFunctionalSpec.groovy index 22c0aa16e..7c693137b 100644 --- a/metacat-functional-tests/src/functionalTest/groovy/com/netflix/metacat/MetacatFunctionalSpec.groovy +++ b/metacat-functional-tests/src/functionalTest/groovy/com/netflix/metacat/MetacatFunctionalSpec.groovy @@ -463,7 +463,7 @@ class MetacatFunctionalSpec extends Specification { def dataUri = "file:/tmp/${catalog.name}/${databaseName}/${tableName}".toString() def definitionMetadata = metacatJson.parseJsonObject('{"objectField": {}}') - def responseDefinitionMetadata = metacatJson.parseJsonObject('{"objectField":{},"owner":{"userId":"metacat-test"}}') + def responseDefinitionMetadata = metacatJson.parseJsonObject('{"objectField":{},"owner":{"userId":"metacat-test"},"parentChildRelationInfo":{}}') def dataMetadata = metacatJson.emptyObjectNode().put('data_field', 4) def dto = new TableDto( name: QualifiedName.ofTable(catalog.name, databaseName, tableName), diff --git a/metacat-main/src/main/java/com/netflix/metacat/main/services/impl/TableServiceImpl.java b/metacat-main/src/main/java/com/netflix/metacat/main/services/impl/TableServiceImpl.java index 42e4c26c1..e11408639 100644 --- a/metacat-main/src/main/java/com/netflix/metacat/main/services/impl/TableServiceImpl.java +++ b/metacat-main/src/main/java/com/netflix/metacat/main/services/impl/TableServiceImpl.java @@ -162,9 +162,9 @@ private ObjectNode createParentChildObjectNode(@Nullable final ParentInfo parent rootNode.set("parentInfo", parentNode); } - if (childInfos.isEmpty()) { + if (!childInfos.isEmpty()) { // Convert Set to an ArrayNode - final ArrayNode childrenArrayNode = objectMapper.createArrayNode(); + final ArrayNode childrenArrayNode = objectMapper.createArrayNode(); for (ChildInfo childInfo : childInfos) { final ObjectNode childNode = objectMapper.createObjectNode(); childNode.put("name", childInfo.getName());