Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camel Quarkus Catalog - Add beans #6199

Open
davsclaus opened this issue Jun 17, 2024 · 3 comments
Open

Camel Quarkus Catalog - Add beans #6199

davsclaus opened this issue Jun 17, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@davsclaus
Copy link
Contributor

Describe the feature here

We recently have added beans as a kind to the catalog, that CEQ does not include

Here is what we include in CSB
https://github.com/apache/camel-spring-boot/tree/main/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/beans

@davsclaus davsclaus added the enhancement New feature or request label Jun 17, 2024
@jamesnetherton jamesnetherton self-assigned this Jun 18, 2024
@zhfeng
Copy link
Contributor

zhfeng commented Jun 18, 2024

In camel-quarkus, we use prepare-catalog-quarkus to generate the catalog. I just tried to add bean kind but it seems that the generatePojoBeanModel in tooling/camel-tooling-model/src/main/java/org/apache/camel/tooling/model/JsonMapper.java is missing the parseArtifact which causes the PojoBeanModel does not include the artifactId and the genreated beans.properties is empty because we filter the models with artifactsId

I create https://issues.apache.org/jira/browse/CAMEL-20887

@zhfeng
Copy link
Contributor

zhfeng commented Jun 18, 2024

Hi @jamesnetherton , I tried the following changes

diff --git a/tooling/maven-plugin/src/main/java/org/apache/camel/quarkus/maven/CqCatalog.java b/tooling/maven-plugin/src/main/java/org/apache/camel/quarkus/maven/CqCatalog.java
index 912b1463d7..348082d2ca 100644
--- a/tooling/maven-plugin/src/main/java/org/apache/camel/quarkus/maven/CqCatalog.java
+++ b/tooling/maven-plugin/src/main/java/org/apache/camel/quarkus/maven/CqCatalog.java
@@ -47,6 +47,7 @@ import org.apache.camel.tooling.model.JsonMapper;
 import org.apache.camel.tooling.model.Kind;
 import org.apache.camel.tooling.model.LanguageModel;
 import org.apache.camel.tooling.model.OtherModel;
+import org.apache.camel.tooling.model.PojoBeanModel;
 import org.apache.camel.tooling.model.TransformerModel;
 
 public class CqCatalog {
@@ -193,6 +194,9 @@ public class CqCatalog {
         }
         String rawJson;
         switch (model.getKind()) {
+        case bean:
+            rawJson = JsonMapper.createParameterJsonSchema((PojoBeanModel) model);
+            break;
         case component:
             rawJson = JsonMapper.createParameterJsonSchema((ComponentModel) model);
             break;
@@ -224,7 +228,7 @@ public class CqCatalog {
 
     public static Stream<Kind> kinds() {
         return Stream.of(Kind.values())
-                .filter(kind -> (kind != Kind.eip && kind != Kind.model && kind != Kind.bean));
+                .filter(kind -> (kind != Kind.eip && kind != Kind.model));
     }

@jamesnetherton
Copy link
Contributor

@zhfeng Thanks for the fix!

Yes, that's the change I have locally. I have a couple of other tidy-ups to make things more consistent compared to the Camel & SB catalogs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants