Federico Mariani created CAMEL-23988:
----------------------------------------
Summary: camel-yaml-dsl - nested-map endpoint parameters
(multiValue, CAMEL-22486) produce a corrupt URI unless the endpoint URI is
scheme-only
Key: CAMEL-23988
URL: https://issues.apache.org/jira/browse/CAMEL-23988
Project: Camel
Issue Type: Bug
Components: camel-yaml-dsl
Affects Versions: 4.21.0
Reporter: Federico Mariani
CAMEL-22486 ({{c79eea752fc9}}) made {{YamlDeserializerSupport.asScalarMap()}}
accept nested MAPPING values so multiValue endpoint options can be written as
YAML maps. However, in {{YamlSupport.creteEndpointUri}}
({{dsl/camel-yaml-dsl/camel-yaml-dsl-common/.../YamlSupport.java:105-125}})
only the {{scheme.equals(uri)}} branch delegates to {{factory.buildUri()}},
which correctly flattens Map values via the multiValue prefixes. The other two
branches — URI with a path (lines 110-122) and no-factory (line 125) — pass the
map straight to {{URISupport.createQueryString}}, which handles List but
stringifies Map values with {{toString()}}.
Failure scenario:
{code:yaml}
uri: "jetty:http://0.0.0.0:8080/x"
parameters:
filterInitParameters:
a: 1
b: 2
{code}
produces {{...?filterInitParameters={a=1, b=2}}} — a silently broken endpoint
URI instead of {{filter.a=1&filter.b=2}} (or an error).
Note the RAW-secret wrapping in lines 112-120 already duplicates part of
{{EndpointUriFactorySupport.buildQueryParameters}} and has drifted by exactly
this missing flattening step — consolidating on the factory path where possible
would prevent further drift. Related inconsistency:
{{YamlSupport.creteEndpointUri(String, Node)}} (scheme-keyed endpoint form,
lines 210-219) still rejects non-scalar parameter values, so the map syntax
works under {{uri:}}/{{parameters:}} but not in the compact scheme-keyed form.
_Filed by Claude Code on behalf of Croway._
--
This message was sent by Atlassian Jira
(v8.20.10#820010)