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

davsclaus pushed a commit to branch worktree-snazzy-petting-map
in repository https://gitbox.apache.org/repos/asf/camel.git

commit c733bcba0b8cc557eddeeb7dd1e7aca49b195c4d
Author: Claus Ibsen <[email protected]>
AuthorDate: Sat Jul 11 09:39:48 2026 +0200

    CAMEL-23983: camel-yaml-dsl - Fix @YamlProperty flag emission for required, 
deprecated, and secret
    
    Co-Authored-By: Claude Opus 4.6 <[email protected]>
    Signed-off-by: Claus Ibsen <[email protected]>
---
 .../dsl/yaml/GenerateYamlDeserializersMojo.java    | 28 ++++++++++------------
 .../maven/dsl/yaml/support/YamlProperties.java     |  2 +-
 2 files changed, 14 insertions(+), 16 deletions(-)

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 e83a2766ec34..d0d60ae00fa9 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
@@ -909,7 +909,7 @@ public class GenerateYamlDeserializersMojo extends 
GenerateYamlSupportMojo {
                                             
.withDescription(descriptor.description(name))
                                             
.withDisplayName(descriptor.displayName(name))
                                             
.withDefaultValue(descriptor.defaultValue(name))
-                                            
.withIsSecret(descriptor.defaultValue(name))
+                                            
.withIsSecret(descriptor.isSecret(name))
                                             .build());
                         }
                         return true;
@@ -948,7 +948,7 @@ public class GenerateYamlDeserializersMojo extends 
GenerateYamlSupportMojo {
                                             
.withDescription(descriptor.description(name))
                                             
.withDisplayName(descriptor.displayName(name))
                                             
.withDefaultValue(descriptor.defaultValue(name))
-                                            
.withIsSecret(descriptor.defaultValue(name))
+                                            
.withIsSecret(descriptor.isSecret(name))
                                             .build());
                         }
                         return true;
@@ -1024,7 +1024,7 @@ public class GenerateYamlDeserializersMojo extends 
GenerateYamlSupportMojo {
             annotations.add(
                     YamlProperties.annotation(fieldName, "enum:" + 
String.join(",", values))
                             .withRequired(isRequired(field))
-                            .withRequired(isDeprecated(field))
+                            .withDeprecated(isDeprecated(field))
                             .withDescription(descriptor.description(fieldName))
                             .withDisplayName(descriptor.displayName(fieldName))
                             
.withDefaultValue(descriptor.defaultValue(fieldName))
@@ -1039,7 +1039,7 @@ public class GenerateYamlDeserializersMojo extends 
GenerateYamlSupportMojo {
             annotations.add(
                     YamlProperties.annotation(fieldName, "enum:" + 
getEnums(field))
                             .withRequired(isRequired(field))
-                            .withRequired(isDeprecated(field))
+                            .withDeprecated(isDeprecated(field))
                             .withDescription(descriptor.description(fieldName))
                             .withDisplayName(descriptor.displayName(fieldName))
                             
.withDefaultValue(descriptor.defaultValue(fieldName))
@@ -1057,13 +1057,11 @@ public class GenerateYamlDeserializersMojo extends 
GenerateYamlSupportMojo {
                             YamlProperties.annotation(fieldName, "string")
                                     .withFormat("binary")
                                     .withRequired(isRequired(field))
-                                    .withRequired(isDeprecated(field))
+                                    .withDeprecated(isDeprecated(field))
                                     
.withDescription(descriptor.description(fieldName))
                                     
.withDisplayName(descriptor.displayName(fieldName))
                                     
.withDefaultValue(descriptor.defaultValue(fieldName))
                                     
.withIsSecret(descriptor.isSecret(fieldName))
-                                    
.withDefaultValue(descriptor.defaultValue(fieldName))
-                                    
.withIsSecret(descriptor.isSecret(fieldName))
                                     .build());
                     break;
                 case "Z":
@@ -1075,7 +1073,7 @@ public class GenerateYamlDeserializersMojo extends 
GenerateYamlSupportMojo {
                     annotations.add(
                             YamlProperties.annotation(fieldName, "boolean")
                                     .withRequired(isRequired(field))
-                                    .withRequired(isDeprecated(field))
+                                    .withDeprecated(isDeprecated(field))
                                     
.withDescription(descriptor.description(fieldName))
                                     
.withDisplayName(descriptor.displayName(fieldName))
                                     
.withDefaultValue(descriptor.defaultValue(fieldName))
@@ -1091,7 +1089,7 @@ public class GenerateYamlDeserializersMojo extends 
GenerateYamlSupportMojo {
                     annotations.add(
                             YamlProperties.annotation(fieldName, "number")
                                     .withRequired(isRequired(field))
-                                    .withRequired(isDeprecated(field))
+                                    .withDeprecated(isDeprecated(field))
                                     
.withDescription(descriptor.description(fieldName))
                                     
.withDisplayName(descriptor.displayName(fieldName))
                                     
.withDefaultValue(descriptor.defaultValue(fieldName))
@@ -1107,7 +1105,7 @@ public class GenerateYamlDeserializersMojo extends 
GenerateYamlSupportMojo {
                     annotations.add(
                             YamlProperties.annotation(fieldName, "number")
                                     .withRequired(isRequired(field))
-                                    .withRequired(isDeprecated(field))
+                                    .withDeprecated(isDeprecated(field))
                                     
.withDescription(descriptor.description(fieldName))
                                     
.withDisplayName(descriptor.displayName(fieldName))
                                     
.withDefaultValue(descriptor.defaultValue(fieldName))
@@ -1123,7 +1121,7 @@ public class GenerateYamlDeserializersMojo extends 
GenerateYamlSupportMojo {
                     annotations.add(
                             YamlProperties.annotation(fieldName, "number")
                                     .withRequired(isRequired(field))
-                                    .withRequired(isDeprecated(field))
+                                    .withDeprecated(isDeprecated(field))
                                     
.withDescription(descriptor.description(fieldName))
                                     
.withDisplayName(descriptor.displayName(fieldName))
                                     
.withDefaultValue(descriptor.defaultValue(fieldName))
@@ -1187,7 +1185,7 @@ public class GenerateYamlDeserializersMojo extends 
GenerateYamlSupportMojo {
                     annotations.add(
                             YamlProperties.annotation(fieldName, "string")
                                     .withRequired(isRequired(field))
-                                    .withRequired(isDeprecated(field))
+                                    .withDeprecated(isDeprecated(field))
                                     
.withDescription(descriptor.description(fieldName))
                                     
.withDisplayName(descriptor.displayName(fieldName))
                                     
.withDefaultValue(descriptor.defaultValue(fieldName))
@@ -1213,7 +1211,7 @@ public class GenerateYamlDeserializersMojo extends 
GenerateYamlSupportMojo {
                     annotations.add(
                             YamlProperties.annotation(fieldName, "number")
                                     .withRequired(isRequired(field))
-                                    .withRequired(isDeprecated(field))
+                                    .withDeprecated(isDeprecated(field))
                                     
.withDescription(descriptor.description(fieldName))
                                     
.withDisplayName(descriptor.displayName(fieldName))
                                     
.withDefaultValue(descriptor.defaultValue(fieldName))
@@ -1229,7 +1227,7 @@ public class GenerateYamlDeserializersMojo extends 
GenerateYamlSupportMojo {
                     annotations.add(
                             YamlProperties.annotation(fieldName, "boolean")
                                     .withRequired(isRequired(field))
-                                    .withRequired(isDeprecated(field))
+                                    .withDeprecated(isDeprecated(field))
                                     
.withDescription(descriptor.description(fieldName))
                                     
.withDisplayName(descriptor.displayName(fieldName))
                                     
.withDefaultValue(descriptor.defaultValue(fieldName))
@@ -1247,7 +1245,7 @@ public class GenerateYamlDeserializersMojo extends 
GenerateYamlSupportMojo {
                                 YamlProperties.annotation(fieldName, "object")
                                         
.withSubType(field.type().name().toString())
                                         .withRequired(isRequired(field))
-                                        .withRequired(isDeprecated(field))
+                                        .withDeprecated(isDeprecated(field))
                                         
.withDescription(descriptor.description(fieldName))
                                         
.withDisplayName(descriptor.displayName(fieldName))
                                         
.withDefaultValue(descriptor.defaultValue(fieldName))
diff --git 
a/dsl/camel-yaml-dsl/camel-yaml-dsl-maven-plugin/src/main/java/org/apache/camel/maven/dsl/yaml/support/YamlProperties.java
 
b/dsl/camel-yaml-dsl/camel-yaml-dsl-maven-plugin/src/main/java/org/apache/camel/maven/dsl/yaml/support/YamlProperties.java
index 5bbd442855cc..377d97767f0d 100644
--- 
a/dsl/camel-yaml-dsl/camel-yaml-dsl-maven-plugin/src/main/java/org/apache/camel/maven/dsl/yaml/support/YamlProperties.java
+++ 
b/dsl/camel-yaml-dsl/camel-yaml-dsl-maven-plugin/src/main/java/org/apache/camel/maven/dsl/yaml/support/YamlProperties.java
@@ -142,7 +142,7 @@ public final class YamlProperties {
             if (node.isMissingNode()) {
                 return this;
             }
-            if (!node.isTextual()) {
+            if (!node.isTextual() && !node.isBoolean()) {
                 return this;
             }
 

Reply via email to