ammachado commented on code in PR #26921: URL: https://github.com/apache/camel/pull/26921#discussion_r4114098215
########## dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/docs/yaml-dsl.adoc: ########## @@ -365,6 +365,23 @@ In addition to the general support for creating beans provided by xref:others:ma <2> the full qualified class name of the bean <3> the properties of the bean to be set +[NOTE] +==== +The beans can also be written as a map keyed by the bean name, without `name:`, as the value of `beans:`: + +[source,yaml] +---- +beans: Review Comment: Thanks for the look. I'm keeping the plain class name here, because it doesn't change behavior: `BeanModelHelper.newInstance` adds the `#class:` prefix to any `type` without a leading `#`: https://github.com/apache/camel/blob/13d63ec4c0e580d232c176a1b8091aec75ec783b/core/camel-core-model/src/main/java/org/apache/camel/model/BeanModelHelper.java#L73-L75 So `type: com.acme.MyBean` creates a new instance just like `type: "#class:com.acme.MyBean"`. It isn't a registry lookup (that would be `#type:` or `#bean:`). The map-form example mirrors the list-form example directly above it (`type: com.acme.MyBean`), which is also how the rest of this page writes the type. I'd like to keep the two forms visually identical, apart from where the name goes. _Claude Code on behalf of Adriano Machado (@ammachado)_ _This was generated by an AI agent and may contain inaccuracies. Please verify before relying on it._ -- 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]
