You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2026/07/11 17:37:00 UTC
[jira] [Updated] (CAMEL-23989) camel-yaml-dsl - YamlDeserializerSupport.nodeAt() matches later pointer segments at the wrong depth instead of returning null
[ https://issues.apache.org/jira/browse/CAMEL-23989?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen updated CAMEL-23989:
--------------------------------
Fix Version/s: 4.22.0
> camel-yaml-dsl - YamlDeserializerSupport.nodeAt() matches later pointer segments at the wrong depth instead of returning null
> -----------------------------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-23989
> URL: https://issues.apache.org/jira/browse/CAMEL-23989
> Project: Camel
> Issue Type: Bug
> Components: camel-yaml-dsl
> Affects Versions: 4.21.0
> Reporter: Federico Mariani
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 4.22.0
>
>
> In {{YamlDeserializerSupport.nodeAt}} ({{dsl/camel-yaml-dsl/camel-yaml-dsl-common/.../YamlDeserializerSupport.java:414-435}}) the outer loop over {{pointer.split("/")}} continues to the next segment when a segment is not found, so it keeps scanning the *same* mapping node for *deeper* segment names, and the remainder computation {{pointer.substring(path.length() + 1)}} is only correct for the first segment.
> Failure scenario: {{nodeAt(root, "/spec/template")}} on a document with no {{spec}} key but a top-level {{template}} key: the loop falls through to {{path = "template"}}, matches the root-level {{template}}, computes {{next = "plate"}} and recurses into it — returning a wrong node, or throwing {{InvalidNodeTypeException}} from {{asMappingNode()}} when the value is a scalar, instead of returning null as the contract implies. Any malformed/partial Kamelet or Pipe document can trigger this via {{KameletRoutesBuilderLoader}}/{{YamlRoutesBuilderLoader}}.
> Important for the fix: the leading-{{/}} pointers used by the loaders only work *because* of this fallthrough (the empty first segment never matches), so empty segments must still be skipped while stopping the cross-level matching. Unchanged since CAMEL-16570; the fallthrough looks accidental, not a feature.
> _Filed by Claude Code on behalf of Croway._
--
This message was sent by Atlassian Jira
(v8.20.10#820010)