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/12/05 09:49:10 UTC

(camel) branch main updated: CAMEL-20188: camel-yaml-dsl - Schema has a lot of inheritErrorHandler that should be removed

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

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


The following commit(s) were added to refs/heads/main by this push:
     new 10b09335df9 CAMEL-20188: camel-yaml-dsl - Schema has a lot of inheritErrorHandler that should be removed
10b09335df9 is described below

commit 10b09335df9d34a5880bd918197adeb18634084f
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Dec 5 10:48:55 2023 +0100

    CAMEL-20188: camel-yaml-dsl - Schema has a lot of inheritErrorHandler that should be removed
---
 .../ROOT/pages/camel-4x-upgrade-guide-4_3.adoc     |   6 +-
 .../maven/dsl/yaml/GenerateYamlSchemaMojo.java     |  19 ++
 .../generated/resources/schema/camelYamlDsl.json   | 201 ---------------------
 3 files changed, 24 insertions(+), 202 deletions(-)

diff --git a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_3.adoc b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_3.adoc
index cd0bc5e21e8..9dd7f030fc7 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_3.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_3.adoc
@@ -63,7 +63,6 @@ The context and route consoles has changed some values in their JSon output data
 
 The values are also changed from String ago to timestamp in millis.For example old value `3m5s` is now `1701599263337`.
 
-
 === camel-jbang
 
 The `camel transform` command has been renamed to `camel transform route` as this command is used for transforming
@@ -85,3 +84,8 @@ the behavior described in the documentation.
 When using the `AsyncCommitManager` then the offset will be committed so that the payload is continually retried. This was
 the behavior described in the documentation.
 
+=== camel-yaml-dsl
+
+The `camelYamlDsl.json` Schema file has removed `inheritErrorHandler` option for all EIPs where it was not applicable.
+This option is only intended for the Load Balancer EIP. This makes the YAML schema in-line with the XML DSL schema.
+
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl-maven-plugin/src/main/java/org/apache/camel/maven/dsl/yaml/GenerateYamlSchemaMojo.java b/dsl/camel-yaml-dsl/camel-yaml-dsl-maven-plugin/src/main/java/org/apache/camel/maven/dsl/yaml/GenerateYamlSchemaMojo.java
index b1c8f364f3e..25db4268dfa 100644
--- a/dsl/camel-yaml-dsl/camel-yaml-dsl-maven-plugin/src/main/java/org/apache/camel/maven/dsl/yaml/GenerateYamlSchemaMojo.java
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl-maven-plugin/src/main/java/org/apache/camel/maven/dsl/yaml/GenerateYamlSchemaMojo.java
@@ -27,6 +27,7 @@ import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Optional;
 import java.util.Set;
 import java.util.TreeMap;
 import java.util.TreeSet;
@@ -281,6 +282,24 @@ public class GenerateYamlSchemaMojo extends GenerateYamlSupportMojo {
                 // this is an internal name
                 continue;
             }
+            // we want to skip inheritErrorHandler which is only applicable for the load-balancer
+            boolean skip = false;
+            if (propertyName.equals("inherit-error-handler")) {
+                skip = true;
+                Optional<AnnotationValue> av = annotationValue(info, YAML_TYPE_ANNOTATION, "nodes");
+                if (av.isPresent()) {
+                    String[] sn = av.get().asStringArray();
+                    for (String n : sn) {
+                        if ("load-balance".equals(n) || "loadBalance".equals(n)) {
+                            skip = false;
+                            break;
+                        }
+                    }
+                }
+            }
+            if (skip) {
+                continue;
+            }
 
             var finalObjectDefinition = objectDefinition;
             if (isInOneOf) {
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 1447e89ffa1..85be73e4872 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
@@ -468,9 +468,6 @@
             "title" : "Ignore Invalid Correlation Keys",
             "description" : "If a correlation key cannot be successfully evaluated it will be ignored by logging a DEBUG and then just ignore the incoming Exchange."
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "optimisticLockRetryPolicy" : {
             "title" : "Optimistic Lock Retry Policy",
             "description" : "Allows to configure retry settings when using optimistic locking.",
@@ -529,9 +526,6 @@
               "title" : "Id",
               "description" : "Sets the id of this node"
             },
-            "inheritErrorHandler" : {
-              "type" : "boolean"
-            },
             "method" : {
               "type" : "string",
               "title" : "Method",
@@ -581,9 +575,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "onWhen" : {
             "title" : "On When",
             "description" : "Sets an additional predicate that should be true before the onCatch is triggered. To be used for fine grained controlling whether a thrown exception should be intercepted by this exception type or not.",
@@ -618,9 +609,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "otherwise" : {
             "title" : "Otherwise",
             "description" : "Sets the otherwise node",
@@ -672,9 +660,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "onFallback" : {
             "title" : "On Fallback",
             "description" : "The fallback route path to execute that does not go over the network. This should be a static or cached result that can immediately be returned upon failure. If the fallback requires network connection then use onFallbackViaNetwork() .",
@@ -729,9 +714,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "key" : {
             "type" : "string",
             "title" : "Key",
@@ -803,9 +785,6 @@
               "title" : "Id",
               "description" : "Sets the id of this node"
             },
-            "inheritErrorHandler" : {
-              "type" : "boolean"
-            },
             "mandatory" : {
               "type" : "boolean",
               "title" : "Mandatory",
@@ -934,9 +913,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "constant" : { },
           "csimple" : { },
           "datasonnet" : { },
@@ -1064,9 +1040,6 @@
             "title" : "Ignore Invalid Endpoints",
             "description" : "Ignore the invalidate endpoint exception when try to create a producer with that endpoint"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "uriDelimiter" : {
             "type" : "string",
             "title" : "Uri Delimiter",
@@ -1225,9 +1198,6 @@
             "title" : "Ignore Invalid Endpoint",
             "description" : "Ignore the invalidate endpoint exception when try to create a producer with that endpoint"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "shareUnitOfWork" : {
             "type" : "boolean",
             "title" : "Share Unit Of Work",
@@ -1788,9 +1758,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "statusPropertyName" : {
             "type" : "string",
             "title" : "Status Property Name",
@@ -1850,9 +1817,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "steps" : {
             "type" : "array",
             "items" : {
@@ -2026,9 +1990,6 @@
             "title" : "Idempotent Repository",
             "description" : "Sets the reference name of the message id repository"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "removeOnFailure" : {
             "type" : "boolean",
             "title" : "Remove On Failure",
@@ -2123,9 +2084,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "steps" : {
             "type" : "array",
             "items" : {
@@ -2158,9 +2116,6 @@
               "title" : "Id",
               "description" : "Sets the id of this node"
             },
-            "inheritErrorHandler" : {
-              "type" : "boolean"
-            },
             "steps" : {
               "type" : "array",
               "items" : {
@@ -2204,9 +2159,6 @@
               "title" : "Id",
               "description" : "Sets the id of this node"
             },
-            "inheritErrorHandler" : {
-              "type" : "boolean"
-            },
             "skipSendToOriginalEndpoint" : {
               "type" : "string",
               "title" : "Skip Send To Original Endpoint",
@@ -2234,9 +2186,6 @@
           "type" : "object",
           "additionalProperties" : false,
           "properties" : {
-            "inheritErrorHandler" : {
-              "type" : "boolean"
-            },
             "name" : {
               "type" : "string"
             },
@@ -2395,9 +2344,6 @@
               "title" : "Id",
               "description" : "Sets the id of this node"
             },
-            "inheritErrorHandler" : {
-              "type" : "boolean"
-            },
             "logName" : {
               "type" : "string",
               "title" : "Log Name",
@@ -2534,9 +2480,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "steps" : {
             "type" : "array",
             "items" : {
@@ -2998,9 +2941,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "asn1" : { },
           "avro" : { },
           "barcode" : { },
@@ -3084,9 +3024,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "onPrepare" : {
             "type" : "string",
             "title" : "On Prepare",
@@ -3162,9 +3099,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "mode" : {
             "type" : "string",
             "title" : "Mode",
@@ -3244,9 +3178,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "onExceptionOccurredRef" : {
             "type" : "string",
             "title" : "On Exception Occurred Ref",
@@ -3321,9 +3252,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "steps" : {
             "type" : "array",
             "items" : {
@@ -3388,9 +3316,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "steps" : {
             "type" : "array",
             "items" : {
@@ -3412,9 +3337,6 @@
           "id" : {
             "type" : "string"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "steps" : {
             "type" : "array",
             "items" : {
@@ -3510,9 +3432,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "untilCheck" : {
             "type" : "string",
             "title" : "Until Check",
@@ -3542,9 +3461,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "steps" : {
             "type" : "array",
             "items" : {
@@ -3574,9 +3490,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "ref" : {
             "type" : "string",
             "title" : "Ref",
@@ -3711,9 +3624,6 @@
             "title" : "Ignore Invalid Endpoint",
             "description" : "Ignore the invalidate endpoint exception when try to create a producer with that endpoint"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "timeout" : {
             "type" : "string",
             "title" : "Timeout",
@@ -3768,9 +3678,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "ref" : {
             "type" : "string",
             "title" : "Ref",
@@ -3958,9 +3865,6 @@
             "title" : "Ignore Invalid Endpoints",
             "description" : "Ignore the invalidate endpoint exception when try to create a producer with that endpoint"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "onPrepare" : {
             "type" : "string",
             "title" : "On Prepare",
@@ -4193,9 +4097,6 @@
               "title" : "Id",
               "description" : "Sets the id of this node"
             },
-            "inheritErrorHandler" : {
-              "type" : "boolean"
-            },
             "name" : {
               "type" : "string",
               "title" : "Name",
@@ -4234,9 +4135,6 @@
               "title" : "Id",
               "description" : "Sets the id of this node"
             },
-            "inheritErrorHandler" : {
-              "type" : "boolean"
-            },
             "pattern" : {
               "type" : "string",
               "title" : "Pattern",
@@ -4275,9 +4173,6 @@
               "title" : "Id",
               "description" : "Sets the id of this node"
             },
-            "inheritErrorHandler" : {
-              "type" : "boolean"
-            },
             "pattern" : {
               "type" : "string",
               "title" : "Pattern",
@@ -4311,9 +4206,6 @@
               "title" : "Id",
               "description" : "Sets the id of this node"
             },
-            "inheritErrorHandler" : {
-              "type" : "boolean"
-            },
             "name" : {
               "type" : "string",
               "title" : "Name",
@@ -4439,9 +4331,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "steps" : {
             "type" : "array",
             "items" : {
@@ -4641,9 +4530,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "intermittent" : {
             "type" : "boolean",
             "title" : "Intermittent",
@@ -4687,9 +4573,6 @@
               "title" : "Id",
               "description" : "Sets the id of this node"
             },
-            "inheritErrorHandler" : {
-              "type" : "boolean"
-            },
             "markRollbackOnly" : {
               "type" : "boolean",
               "title" : "Mark Rollback Only",
@@ -5088,9 +4971,6 @@
               "title" : "Ignore Invalid Endpoints",
               "description" : "Ignore the invalidate endpoint exception when try to create a producer with that endpoint"
             },
-            "inheritErrorHandler" : {
-              "type" : "boolean"
-            },
             "uriDelimiter" : {
               "type" : "string",
               "title" : "Uri Delimiter",
@@ -5141,9 +5021,6 @@
             "id" : {
               "type" : "string"
             },
-            "inheritErrorHandler" : {
-              "type" : "boolean"
-            },
             "parameters" : {
               "type" : "object"
             },
@@ -5192,9 +5069,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "option" : {
             "type" : "array",
             "title" : "Option",
@@ -5252,9 +5126,6 @@
               "title" : "Id",
               "description" : "Sets the id of this node"
             },
-            "inheritErrorHandler" : {
-              "type" : "boolean"
-            },
             "messageFrequency" : {
               "type" : "number",
               "title" : "Message Frequency",
@@ -5359,9 +5230,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "constant" : { },
           "csimple" : { },
           "datasonnet" : { },
@@ -5479,9 +5347,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "constant" : { },
           "csimple" : { },
           "datasonnet" : { },
@@ -5533,9 +5398,6 @@
               "title" : "Id",
               "description" : "Sets the id of this node"
             },
-            "inheritErrorHandler" : {
-              "type" : "boolean"
-            },
             "pattern" : {
               "type" : "string",
               "title" : "Pattern",
@@ -5635,9 +5497,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "name" : {
             "type" : "string",
             "title" : "Name",
@@ -5697,9 +5556,6 @@
             "type" : "string",
             "title" : "Id",
             "description" : "Sets the id of this node"
-          },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
           }
         }
       },
@@ -5793,9 +5649,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "name" : {
             "type" : "string",
             "title" : "Name",
@@ -5924,9 +5777,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "constant" : { },
           "csimple" : { },
           "datasonnet" : { },
@@ -6070,9 +5920,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "onPrepare" : {
             "type" : "string",
             "title" : "On Prepare",
@@ -6168,9 +6015,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "steps" : {
             "type" : "array",
             "items" : {
@@ -6199,9 +6043,6 @@
             "type" : "string",
             "title" : "Id",
             "description" : "Sets the id of this node"
-          },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
           }
         }
       },
@@ -6377,9 +6218,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "keepAliveTime" : {
             "type" : "number",
             "title" : "Keep Alive Time",
@@ -6530,9 +6368,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "rejectExecution" : {
             "type" : "boolean",
             "title" : "Reject Execution",
@@ -6591,9 +6426,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "message" : {
             "type" : "string",
             "title" : "Message",
@@ -6630,9 +6462,6 @@
               "title" : "Id",
               "description" : "Sets the id of this node"
             },
-            "inheritErrorHandler" : {
-              "type" : "boolean"
-            },
             "parameters" : {
               "type" : "object"
             },
@@ -6695,9 +6524,6 @@
               "title" : "Ignore Invalid Endpoint",
               "description" : "Whether to ignore invalid endpoint URIs and skip sending the message."
             },
-            "inheritErrorHandler" : {
-              "type" : "boolean"
-            },
             "parameters" : {
               "type" : "object"
             },
@@ -6737,9 +6563,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "ref" : {
             "type" : "string",
             "title" : "Ref",
@@ -6848,9 +6671,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "toType" : {
             "type" : "string",
             "title" : "To Type",
@@ -6913,9 +6733,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "steps" : {
             "type" : "array",
             "items" : {
@@ -6950,9 +6767,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "asn1" : { },
           "avro" : { },
           "barcode" : { },
@@ -7492,9 +7306,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "predicateExceptionFactory" : {
             "type" : "string",
             "title" : "Predicate Exception Factory",
@@ -7634,9 +7445,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "steps" : {
             "type" : "array",
             "items" : {
@@ -7760,9 +7568,6 @@
             "title" : "Id",
             "description" : "Sets the id of this node"
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "steps" : {
             "type" : "array",
             "items" : {
@@ -7852,9 +7657,6 @@
             "title" : "Ignore Invalid Endpoint",
             "description" : "Whether to ignore invalid endpoint URIs and skip sending the message."
           },
-          "inheritErrorHandler" : {
-            "type" : "boolean"
-          },
           "onPrepare" : {
             "type" : "string",
             "title" : "On Prepare",
@@ -8926,9 +8728,6 @@
               "title" : "Id",
               "description" : "Sets the id of this node"
             },
-            "inheritErrorHandler" : {
-              "type" : "boolean"
-            },
             "loadBalancerRef" : {
               "type" : "string",
               "title" : "Load Balancer Ref",