From 527849bdef2e274be6b9fc8445bc137668db9eef Mon Sep 17 00:00:00 2001 From: "Ricardo M." Date: Thu, 3 Oct 2024 18:13:57 +0200 Subject: [PATCH] fix(catalog-generator): Use Label or Group for the EIP parameters grouping fix: https://github.com/KaotoIO/kaoto/issues/1381 --- packages/catalog-generator/pom.xml | 11 ++++++----- .../camelcatalog/generator/CamelCatalogProcessor.java | 8 +++++++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/catalog-generator/pom.xml b/packages/catalog-generator/pom.xml index c79db29bf..8f52822c2 100644 --- a/packages/catalog-generator/pom.xml +++ b/packages/catalog-generator/pom.xml @@ -37,11 +37,6 @@ camel-catalog ${version.camel} - - org.apache.camel - camel-yaml-dsl - ${version.camel} - org.apache.camel camel-catalog-maven @@ -82,6 +77,12 @@ commons-cli 1.9.0 + + org.apache.camel + camel-yaml-dsl + ${version.camel} + test + org.junit.jupiter junit-jupiter diff --git a/packages/catalog-generator/src/main/java/io/kaoto/camelcatalog/generator/CamelCatalogProcessor.java b/packages/catalog-generator/src/main/java/io/kaoto/camelcatalog/generator/CamelCatalogProcessor.java index 0e33268be..d0efb4421 100644 --- a/packages/catalog-generator/src/main/java/io/kaoto/camelcatalog/generator/CamelCatalogProcessor.java +++ b/packages/catalog-generator/src/main/java/io/kaoto/camelcatalog/generator/CamelCatalogProcessor.java @@ -373,7 +373,13 @@ public String getPatternCatalog() throws Exception { required.add(propertyName); } - propertySchema.put("group", catalogOp.getGroup()); + /* In Apache Camel previous to 4.5.0, the displayName is stored in the label property */ + if (catalogOp.getLabel() != null) { + propertySchema.put("group", catalogOp.getLabel()); + } else if (catalogOp.getGroup() != null) { + propertySchema.put("group", catalogOp.getGroup()); + } + sortedSchemaProperties.set(propertyName, propertySchema); }