You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2023/10/23 13:01:07 UTC

[camel] branch choice-steps created (now 2ff11ec448e)

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a change to branch choice-steps
in repository https://gitbox.apache.org/repos/asf/camel.git


      at 2ff11ec448e CAMEL-20032: camel-yaml-dsl - Choice should not have steps in schema

This branch includes the following new commits:

     new 2ff11ec448e CAMEL-20032: camel-yaml-dsl - Choice should not have steps in schema

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[camel] 01/01: CAMEL-20032: camel-yaml-dsl - Choice should not have steps in schema

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch choice-steps
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 2ff11ec448e998c0b7c70595f350aec85c14b760
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Oct 23 15:00:44 2023 +0200

    CAMEL-20032: camel-yaml-dsl - Choice should not have steps in schema
---
 .../camel/dsl/yaml/deserializers/ModelDeserializers.java      |  5 -----
 .../camel/maven/dsl/yaml/GenerateYamlDeserializersMojo.java   | 11 ++++++++++-
 .../src/generated/resources/schema/camelYamlDsl.json          |  6 ------
 3 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java
index 2dfd38739da..324087602e7 100644
--- a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java
@@ -1749,7 +1749,6 @@ public final class ModelDeserializers extends YamlDeserializerSupport {
                     @YamlProperty(name = "inherit-error-handler", type = "boolean"),
                     @YamlProperty(name = "otherwise", type = "object:org.apache.camel.model.OtherwiseDefinition", description = "Sets the otherwise node", displayName = "Otherwise"),
                     @YamlProperty(name = "precondition", type = "boolean", description = "Indicates whether this Choice EIP is in precondition mode or not. If so its branches (when/otherwise) are evaluated during startup to keep at runtime only the branch that matched.", displayName = "Precondition"),
-                    @YamlProperty(name = "steps", type = "array:org.apache.camel.model.ProcessorDefinition"),
                     @YamlProperty(name = "when", type = "array:org.apache.camel.model.WhenDefinition", description = "Sets the when nodes", displayName = "When")
             }
     )
@@ -1802,10 +1801,6 @@ public final class ModelDeserializers extends YamlDeserializerSupport {
                     target.setDescription(val);
                     break;
                 }
-                case "steps": {
-                    setSteps(target, node);
-                    break;
-                }
                 default: {
                     return false;
                 }
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl-maven-plugin/src/main/java/org/apache/camel/maven/dsl/yaml/GenerateYamlDeserializersMojo.java b/dsl/camel-yaml-dsl/camel-yaml-dsl-maven-plugin/src/main/java/org/apache/camel/maven/dsl/yaml/GenerateYamlDeserializersMojo.java
index d8d941e21fd..d1343806f93 100644
--- a/dsl/camel-yaml-dsl/camel-yaml-dsl-maven-plugin/src/main/java/org/apache/camel/maven/dsl/yaml/GenerateYamlDeserializersMojo.java
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl-maven-plugin/src/main/java/org/apache/camel/maven/dsl/yaml/GenerateYamlDeserializersMojo.java
@@ -550,7 +550,7 @@ public class GenerateYamlDeserializersMojo extends GenerateYamlSupportMojo {
                             .build());
         }
 
-        if (implementType(info, OUTPUT_NODE_CLASS)) {
+        if (shouldHaveSteps(info)) {
             caseAdded = true;
 
             setProperty.beginControlFlow("case \"steps\":");
@@ -1253,4 +1253,13 @@ public class GenerateYamlDeserializersMojo extends GenerateYamlSupportMojo {
 
         return true;
     }
+
+    private boolean shouldHaveSteps(ClassInfo info) {
+        // choice should not have steps
+        if ("ChoiceDefinition".equals(info.simpleName())) {
+            return false;
+        }
+        return implementType(info, OUTPUT_NODE_CLASS);
+    }
+
 }
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json
index ecb630c593f..3a0e0a9e1f3 100644
--- a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json
@@ -628,12 +628,6 @@
             "title" : "Precondition",
             "description" : "Indicates whether this Choice EIP is in precondition mode or not. If so its branches (when/otherwise) are evaluated during startup to keep at runtime only the branch that matched."
           },
-          "steps" : {
-            "type" : "array",
-            "items" : {
-              "$ref" : "#/items/definitions/org.apache.camel.model.ProcessorDefinition"
-            }
-          },
           "when" : {
             "type" : "array",
             "title" : "When",