davsclaus commented on code in PR #28021:
URL: https://github.com/apache/camel/pull/28021#discussion_r4303237849


##########
dsl/camel-yaml-dsl/camel-yaml-dsl-validator/src/main/java/org/apache/camel/dsl/yaml/validator/DocBlocks.java:
##########
@@ -57,14 +62,52 @@ public static List<String> examples(String doc) {
         }
         Matcher m = YAML_BLOCK.matcher(doc);
         while (m.find()) {
-            String yaml = 
CALLOUT.matcher(m.group(1)).replaceAll("").stripTrailing() + "\n";
-            if (yaml.stripLeading().startsWith("- ") && !markedToSkip(doc, 
m.start())) {
+            String yaml = 
CALLOUT.matcher(m.group(2)).replaceAll("").stripTrailing() + "\n";
+            if (startsWithEntry(yaml) && !markedToSkip(doc, m.start())) {
                 answer.add(yaml);
             }
         }
         return answer;
     }
 
+    /** The entries a YAML DSL file is a list of. */
+    private static final Set<String> TOP_LEVEL = Set.of("beans", 
"dataFormats", "errorHandler", "from", "intercept",
+            "interceptFrom", "interceptSendToEndpoint", "kamelet", 
"onCompletion", "onException", "rest",
+            "restConfiguration", "route", "route-configuration", 
"route-template", "routeConfiguration", "routeTemplate",
+            "sslContextParameters", "templated-route", "templatedRoute", 
"transformers", "validators");

Review Comment:
   Right, checked against items.properties of camelYamlDsl.json. Fixed in 
c619d6952128: kamelet is out, semantic is in. DocBlocksTest has a case for both.
   
   _Claude Code on behalf of davsclaus_



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to