This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch var
in repository https://gitbox.apache.org/repos/asf/camel.git
commit b7a068594820f5ea4642707eb9a2fccab3947394
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Dec 30 13:28:47 2023 +0100
CAMEL-19749: Add variables as concept to Camel
---
.../java/org/apache/camel/impl/console/VariablesDevConsole.java | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/core/camel-console/src/main/java/org/apache/camel/impl/console/VariablesDevConsole.java b/core/camel-console/src/main/java/org/apache/camel/impl/console/VariablesDevConsole.java
index 87018f3bf9a..4f1e95415ac 100644
--- a/core/camel-console/src/main/java/org/apache/camel/impl/console/VariablesDevConsole.java
+++ b/core/camel-console/src/main/java/org/apache/camel/impl/console/VariablesDevConsole.java
@@ -60,10 +60,6 @@ public class VariablesDevConsole extends AbstractDevConsole {
Set<BrowsableVariableRepository> repos = getCamelContext().getRegistry().findByType(BrowsableVariableRepository.class);
for (BrowsableVariableRepository repo : repos) {
List<JsonObject> arr = new ArrayList<>();
- JsonObject jo = new JsonObject();
- root.put(repo.getId(), jo);
- jo.put("id", repo.getId());
- jo.put("size", repo.size());
for (Map.Entry<String, Object> entry : repo.getVariables().entrySet()) {
String k = entry.getKey();
Object v = entry.getValue();
@@ -77,7 +73,7 @@ public class VariablesDevConsole extends AbstractDevConsole {
arr.add(e);
}
if (!arr.isEmpty()) {
- jo.put("variables", arr);
+ root.put(repo.getId(), arr);
}
}