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 91bb896e25374ac04f0f1840b6e4adfa60b0dbf1
Author: Claus Ibsen <[email protected]>
AuthorDate: Sat Jul 11 09:48:34 2026 +0200

    CAMEL-23984: camel-yaml-dsl - Log warning when unsupported top-level YAML 
mapping is silently ignored
    
    Co-Authored-By: Claude Opus 4.6 <[email protected]>
    Signed-off-by: Claus Ibsen <[email protected]>
---
 .../apache/camel/dsl/yaml/YamlRoutesBuilderLoader.java   | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git 
a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/java/org/apache/camel/dsl/yaml/YamlRoutesBuilderLoader.java
 
b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/java/org/apache/camel/dsl/yaml/YamlRoutesBuilderLoader.java
index 0c2edbc71c92..197284b6cd11 100644
--- 
a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/java/org/apache/camel/dsl/yaml/YamlRoutesBuilderLoader.java
+++ 
b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/java/org/apache/camel/dsl/yaml/YamlRoutesBuilderLoader.java
@@ -160,7 +160,13 @@ public class YamlRoutesBuilderLoader extends 
YamlRoutesBuilderLoaderSupport {
                             }
                         }
                     } else {
-                        doConfigure(target);
+                        boolean accepted = doConfigure(target);
+                        if (!accepted) {
+                            String loc = ctx.getResource() != null ? 
ctx.getResource().getLocation() : "";
+                            LOG.warn(
+                                    "Unsupported top-level YAML node in 
resource: {}. Ensure the YAML file uses a sequence (list) of route 
definitions.",
+                                    loc);
+                        }
                     }
                 }
 
@@ -326,7 +332,13 @@ public class YamlRoutesBuilderLoader extends 
YamlRoutesBuilderLoaderSupport {
                             }
                         }
                     } else {
-                        doConfiguration(target);
+                        boolean accepted = doConfiguration(target);
+                        if (!accepted) {
+                            String loc = ctx.getResource() != null ? 
ctx.getResource().getLocation() : "";
+                            LOG.warn(
+                                    "Unsupported top-level YAML node in 
resource: {}. Ensure the YAML file uses a sequence (list) of route 
definitions.",
+                                    loc);
+                        }
                     }
                 }
             }

Reply via email to