[
https://issues.apache.org/jira/browse/CAMEL-23534?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18081774#comment-18081774
]
Claus Ibsen commented on CAMEL-23534:
-------------------------------------
Should this be backported to 4.18.x ?
> Schema properties are URL-encoded when passed from Pipe to Kamelet, breaking
> Protobuf/Avro schema parsers
> ---------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-23534
> URL: https://issues.apache.org/jira/browse/CAMEL-23534
> Project: Camel
> Issue Type: Bug
> Components: camel-kamelet
> Reporter: Thomas Cunningham
> Assignee: Thomas Cunningham
> Priority: Major
> Fix For: 4.21.0
>
>
> Description:
> When a Camel Pipe references a Kamelet with properties containing special
> characters (e.g., Protobuf/Avro schemas), those property values are
> URL-encoded by
> YamlRoutesBuilderLoader.createQueryString() at line 605 but never decoded
> before being passed to the kamelet's bean setters.
>
> {code:java}
> Location:
> /Users/tcunning/fixingkamelets/camel/dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/java/org/apache/camel/dsl/yaml/YamlRoutesBuilderLoader.java:605-608
> 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;
> }
> {code}
>
>
> Example:
> - Pipe YAML property: schema: "syntax = \"proto3\";"
> - Becomes kamelet URI parameter: schema=syntax+%3D+%22proto3%22%3B
> - Arrives at ProtobufSchemaResolver.setSchema():
> "syntax+%3D+%22proto3%22%3B"
> - Parser fails: Syntax error at 1:8: expected '=' (sees syntax+%3D instead
> of syntax =)
>
> Affected Components:
> - camel-jackson-protobuf: ProtobufSchemaResolver
> - camel-jackson-avro: AvroSchemaResolver
> - camel-kamelet: MimeType enum
> - Any kamelet that passes complex string properties (schemas, expressions,
> templates)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)