chore: Bump version to 1.6.15 and enhance JsonAgentResponseHandler to improve array entry parsing
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -4,7 +4,7 @@
|
||||
<artifactId>lm-lib</artifactId>
|
||||
<groupId>de.extio</groupId>
|
||||
<name>lm-lib</name>
|
||||
<version>1.6.14</version>
|
||||
<version>1.6.15</version>
|
||||
|
||||
<properties>
|
||||
<java.version>21</java.version>
|
||||
|
||||
@@ -83,7 +83,16 @@ public class JsonAgentResponseHandler implements AgentResponseHandler {
|
||||
|
||||
private void parseEntry(final LinkedHashMap<String, List<String>> items, final Entry<String, JsonNode> entry) {
|
||||
if (entry.getValue().isArray()) {
|
||||
entry.getValue().elements().forEachRemaining(nestedArray -> nestedArray.properties().forEach(nestedProperty -> this.parseEntry(items, nestedProperty)));
|
||||
entry.getValue().elements().forEachRemaining(nestedArrayValue -> {
|
||||
if (nestedArrayValue.properties().isEmpty()) {
|
||||
items.computeIfAbsent(this.prefixFields + entry.getKey(), k -> new ArrayList<>()).add(nestedArrayValue.asText());
|
||||
}
|
||||
else {
|
||||
for (final var nestedProperty : nestedArrayValue.properties()) {
|
||||
this.parseEntry(items, nestedProperty);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
this.parseProperty(items, entry);
|
||||
|
||||
Reference in New Issue
Block a user