This is an automated email from the ASF dual-hosted git repository.
fmariani pushed a commit to branch CAMEL-23284-4.18.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/CAMEL-23284-4.18.x by this
push:
new 02cbc55229f4 CAMEL-23284: Fix Pipe Kamelet properties with
{{placeholder}} being URL-encoded
02cbc55229f4 is described below
commit 02cbc55229f4c814d78841395db6b3db2f74559a
Author: Croway <[email protected]>
AuthorDate: Thu Apr 2 14:15:20 2026 +0200
CAMEL-23284: Fix Pipe Kamelet properties with {{placeholder}} being
URL-encoded
---
.../camel/dsl/yaml/YamlRoutesBuilderLoader.java | 2 ++
.../apache/camel/dsl/yaml/PipeLoaderTest.groovy | 36 ++++++++++++++++++++++
2 files changed, 38 insertions(+)
diff --git
a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/java/org/apache/camel/dsl/yaml/YamlRoutesBuilderLoader.java
b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/java/org/apache/camel/dsl/yaml/YamlRoutesBuilderLoader.java
index ca6499b2891d..91ec6b1e4694 100644
---
a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/java/org/apache/camel/dsl/yaml/YamlRoutesBuilderLoader.java
+++
b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/java/org/apache/camel/dsl/yaml/YamlRoutesBuilderLoader.java
@@ -574,6 +574,8 @@ public class YamlRoutesBuilderLoader extends
YamlRoutesBuilderLoaderSupport {
if (params != null && !params.isEmpty()) {
String query = URISupport.createQueryString(params);
+ // CAMEL-23284: restore property placeholders that were URL-encoded
+ query = query.replace("%7B%7B", "{{").replace("%7D%7D", "}}");
uri = uri + "?" + query;
}
diff --git
a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/PipeLoaderTest.groovy
b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/PipeLoaderTest.groovy
index 00dd9ed5f039..1a7ab53c3ed2 100644
---
a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/PipeLoaderTest.groovy
+++
b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/PipeLoaderTest.groovy
@@ -791,4 +791,40 @@ class PipeLoaderTest extends YamlTestSupport {
}
}
+ def "Pipe kamelet property with placeholder should not be URL-encoded"() {
+ setup:
+ context.propertiesComponent.setInitialProperties(['my.message': 'Hello
Camel'] as Properties)
+
+ when:
+ loadBindings('''
+ apiVersion: camel.apache.org/v1
+ kind: Pipe
+ metadata:
+ name: placeholder-pipe
+ spec:
+ source:
+ ref:
+ kind: Kamelet
+ apiVersion: camel.apache.org/v1
+ name: timer-source
+ properties:
+ message: "{{my.message}}"
+ sink:
+ ref:
+ kind: Kamelet
+ apiVersion: camel.apache.org/v1
+ name: log-sink
+ ''')
+ then:
+ context.routeDefinitions.size() == 3
+
+ with (context.routeDefinitions[0]) {
+ routeId == 'placeholder-pipe'
+ // CAMEL-23284: verify placeholder is preserved and NOT
URL-encoded to %7B%7B...%7D%7D
+ input.endpointUri == 'kamelet:timer-source?message={{my.message}}'
+ !input.endpointUri.contains('%7B')
+ !input.endpointUri.contains('%7D')
+ }
+ }
+
}