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 dc6b5b3c5f381..b1c8f364f3eb3 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 @@ -473,6 +473,17 @@ private void collectYamlProperties(List annotations, ClassIn } } + if (!kebabCase) { + final String camelCased = StringHelper.dashToCamelCase(propertyName); + if (annotations.stream().anyMatch(existing -> { + String existingName = annotationValue(existing, "name").map(AnnotationValue::asString).orElse(""); + String existingCamelCased = StringHelper.dashToCamelCase(existingName); + return existingCamelCased.equals(camelCased); + })) { + return; + } + } + if (propertyName.startsWith("__")) { // reserved property, add it annotations.add(property); 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 3a0e0a9e1f344..7c1bfd10e151f 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 @@ -846,8 +846,6 @@ "required" : [ "datasonnet" ] }, { "required" : [ "exchangeProperty" ] - }, { - "required" : [ "exchangeProperty" ] }, { "required" : [ "groovy" ] }, { @@ -980,8 +978,6 @@ "required" : [ "datasonnet" ] }, { "required" : [ "exchangeProperty" ] - }, { - "required" : [ "exchangeProperty" ] }, { "required" : [ "groovy" ] }, { @@ -1115,8 +1111,6 @@ "required" : [ "datasonnet" ] }, { "required" : [ "exchangeProperty" ] - }, { - "required" : [ "exchangeProperty" ] }, { "required" : [ "groovy" ] }, { @@ -1351,8 +1345,6 @@ "required" : [ "datasonnet" ] }, { "required" : [ "exchangeProperty" ] - }, { - "required" : [ "exchangeProperty" ] }, { "required" : [ "groovy" ] }, { @@ -1417,14 +1409,6 @@ "$ref" : "#/items/definitions/org.apache.camel.model.language.ExchangePropertyExpression" } } - }, { - "type" : "object", - "required" : [ "exchangeProperty" ], - "properties" : { - "exchangeProperty" : { - "$ref" : "#/items/definitions/org.apache.camel.model.language.ExchangePropertyExpression" - } - } }, { "type" : "object", "required" : [ "groovy" ], @@ -1711,8 +1695,6 @@ "required" : [ "datasonnet" ] }, { "required" : [ "exchangeProperty" ] - }, { - "required" : [ "exchangeProperty" ] }, { "required" : [ "groovy" ] }, { @@ -1933,8 +1915,6 @@ "required" : [ "datasonnet" ] }, { "required" : [ "exchangeProperty" ] - }, { - "required" : [ "exchangeProperty" ] }, { "required" : [ "groovy" ] }, { @@ -2440,8 +2420,6 @@ "required" : [ "datasonnet" ] }, { "required" : [ "exchangeProperty" ] - }, { - "required" : [ "exchangeProperty" ] }, { "required" : [ "groovy" ] }, { @@ -3601,8 +3579,6 @@ "required" : [ "datasonnet" ] }, { "required" : [ "exchangeProperty" ] - }, { - "required" : [ "exchangeProperty" ] }, { "required" : [ "groovy" ] }, { @@ -3841,8 +3817,6 @@ "required" : [ "datasonnet" ] }, { "required" : [ "exchangeProperty" ] - }, { - "required" : [ "exchangeProperty" ] }, { "required" : [ "groovy" ] }, { @@ -4331,8 +4305,6 @@ "required" : [ "datasonnet" ] }, { "required" : [ "exchangeProperty" ] - }, { - "required" : [ "exchangeProperty" ] }, { "required" : [ "groovy" ] }, { @@ -4995,8 +4967,6 @@ "required" : [ "datasonnet" ] }, { "required" : [ "exchangeProperty" ] - }, { - "required" : [ "exchangeProperty" ] }, { "required" : [ "groovy" ] }, { @@ -5275,8 +5245,6 @@ "required" : [ "datasonnet" ] }, { "required" : [ "exchangeProperty" ] - }, { - "required" : [ "exchangeProperty" ] }, { "required" : [ "groovy" ] }, { @@ -5394,8 +5362,6 @@ "required" : [ "datasonnet" ] }, { "required" : [ "exchangeProperty" ] - }, { - "required" : [ "exchangeProperty" ] }, { "required" : [ "groovy" ] }, { @@ -5549,8 +5515,6 @@ "required" : [ "datasonnet" ] }, { "required" : [ "exchangeProperty" ] - }, { - "required" : [ "exchangeProperty" ] }, { "required" : [ "groovy" ] }, { @@ -5674,8 +5638,6 @@ "required" : [ "datasonnet" ] }, { "required" : [ "exchangeProperty" ] - }, { - "required" : [ "exchangeProperty" ] }, { "required" : [ "groovy" ] }, { @@ -5799,8 +5761,6 @@ "required" : [ "datasonnet" ] }, { "required" : [ "exchangeProperty" ] - }, { - "required" : [ "exchangeProperty" ] }, { "required" : [ "groovy" ] }, { @@ -5923,8 +5883,6 @@ "required" : [ "datasonnet" ] }, { "required" : [ "exchangeProperty" ] - }, { - "required" : [ "exchangeProperty" ] }, { "required" : [ "groovy" ] }, { @@ -6388,8 +6346,6 @@ "required" : [ "datasonnet" ] }, { "required" : [ "exchangeProperty" ] - }, { - "required" : [ "exchangeProperty" ] }, { "required" : [ "groovy" ] }, { @@ -6726,8 +6682,6 @@ "required" : [ "datasonnet" ] }, { "required" : [ "exchangeProperty" ] - }, { - "required" : [ "exchangeProperty" ] }, { "required" : [ "groovy" ] }, { @@ -7374,8 +7328,6 @@ "required" : [ "datasonnet" ] }, { "required" : [ "exchangeProperty" ] - }, { - "required" : [ "exchangeProperty" ] }, { "required" : [ "groovy" ] }, { @@ -7515,8 +7467,6 @@ "required" : [ "datasonnet" ] }, { "required" : [ "exchangeProperty" ] - }, { - "required" : [ "exchangeProperty" ] }, { "required" : [ "groovy" ] }, { @@ -7640,8 +7590,6 @@ "required" : [ "datasonnet" ] }, { "required" : [ "exchangeProperty" ] - }, { - "required" : [ "exchangeProperty" ] }, { "required" : [ "groovy" ] }, { @@ -12211,14 +12159,6 @@ "$ref" : "#/items/definitions/org.apache.camel.model.language.ExchangePropertyExpression" } } - }, { - "type" : "object", - "required" : [ "exchangeProperty" ], - "properties" : { - "exchangeProperty" : { - "$ref" : "#/items/definitions/org.apache.camel.model.language.ExchangePropertyExpression" - } - } }, { "type" : "object", "required" : [ "groovy" ],