Skip to content

Commit b41e069

Browse files
committed
Omit server properties with no value
1 parent 5e29152 commit b41e069

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

schemacrawler-ai-core/src/main/java/schemacrawler/tools/ai/functions/ServerInformationFunctionExecutor.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@
99
package schemacrawler.tools.ai.functions;
1010

1111
import static schemacrawler.tools.ai.utility.JsonUtility.mapper;
12-
12+
import java.util.Collection;
1313
import com.fasterxml.jackson.databind.JsonNode;
1414
import com.fasterxml.jackson.databind.node.ArrayNode;
1515
import com.fasterxml.jackson.databind.node.ObjectNode;
16-
import java.util.Collection;
1716
import schemacrawler.schemacrawler.SchemaCrawlerOptions;
1817
import schemacrawler.schemacrawler.SchemaCrawlerOptionsBuilder;
1918
import schemacrawler.tools.ai.tools.FunctionReturn;
@@ -55,13 +54,13 @@ private JsonNode createServerInfoArray() {
5554
final ArrayNode serverInfoArray = databaseInfo.putArray("server-info");
5655
final Collection<Property> serverInfo = catalog.getDatabaseInfo().getServerInfo();
5756
for (final Property serverProperty : serverInfo) {
58-
if (serverProperty == null) {
57+
if (serverProperty == null || serverProperty.getValue() == null) {
5958
continue;
6059
}
6160
final ObjectNode serverPropertyNode = serverInfoArray.addObject();
6261
serverPropertyNode.put("name", serverProperty.getName());
6362
serverPropertyNode.put("description", serverProperty.getDescription());
64-
serverPropertyNode.put("value", String.valueOf(serverProperty.getValue()));
63+
serverPropertyNode.put("value", serverProperty.getValue().toString());
6564
}
6665

6766
return databaseInfo;

0 commit comments

Comments
 (0)