[ 
https://issues.apache.org/jira/browse/CAMEL-24745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18117319#comment-18117319
 ] 

Claus Ibsen commented on CAMEL-24745:
-------------------------------------

Decision: the canonical form requires {{route:}}, so a top-level {{from:}} is 
the compact notation.

The reasoning: XML routes have always been {{<route>}} with {{<from>}} inside 
it, and the YAML DSL follows the XML shape, so YAML is always {{- route:}} too. 
The Java DSL is the exception, where {{from("...")}} on a RouteBuilder is 
itself the route, but that is a Java convenience, not a document shape.

So the fix is the first option in the description:
* the canonical schema generator drops {{from}} from the top-level entries of 
{{camelYamlDsl-canonical.json}}
* the validator reports a top-level {{from:}} with the canonical form ({{- 
route: {from: {uri: ..., steps: [...]}}}}), the way it reports the other 
compact shapes
* the runtime keeps its warning as is

> camel-yaml-dsl - decide whether a top-level from: (without route:) is the 
> compact notation: the runtime warns on it, the canonical schema accepts it
> ----------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-24745
>                 URL: https://issues.apache.org/jira/browse/CAMEL-24745
>             Project: Camel
>          Issue Type: Task
>          Components: camel-yaml-dsl
>            Reporter: Claus Ibsen
>            Assignee: Guillaume Nodet
>            Priority: Major
>
> The runtime WARN for the compact notation 
> ({{YamlDeserializationContext.warnCompactNotationOnce}}) fires for a 
> top-level {{- from:}} without {{- route:}} 
> ({{YamlRoutesBuilderLoader.doConfigure}}, the {{OutputAwareFromDefinition}} 
> case), while the canonical schema ({{camelYamlDsl-canonical.json}}) lists 
> {{from}} among its top-level entries and {{camel validate yaml --canonical}} 
> accepts it (CAMEL-24723). So {{camel run}} and the validator disagree on this 
> one shape.
> Decide which is right and align the other:
> * if a top-level {{from:}} is compact, the canonical schema generator drops 
> {{from}} from the top-level entries, and the validator reports it with the 
> canonical form ({{- route: {from: {uri: ..., steps: [...]}}}}) the way it 
> reports the other shapes
> * if it is not, the loader stops warning on it
> The documentation examples went to {{- route:}} in CAMEL-24710 (1917 {{- 
> route:}} against 36 {{- from:}} in the catalog docs now), which points to the 
> first.
> Noted on CAMEL-24723.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to