Skip to content

CAMEL-23594: Fix kamelet properties being URL-encoded in YAML DSL - #24170

Merged
davsclaus merged 3 commits into
mainfrom
fix/CAMEL-23594
Jun 22, 2026
Merged

CAMEL-23594: Fix kamelet properties being URL-encoded in YAML DSL#24170
davsclaus merged 3 commits into
mainfrom
fix/CAMEL-23594

Conversation

@davsclaus

Copy link
Copy Markdown
Contributor

Summary

  • Fix kamelet parameter values being URL-encoded by the YAML DSL but never decoded, because KameletComponent uses useRawUri()=true. Values like application/json were arriving as application%2Fjson in kamelet templates, causing HTTP 415 errors in kamelet integration tests.
  • The root cause is YamlRoutesBuilderLoader calling URISupport.createQueryString(params) which defaults to encode=true. Changed to createQueryString(params, !kamelet) to skip encoding for kamelet URIs, matching what KameletDeserializer and YamlSupport already do.
  • Added test in KameletTest.groovy verifying that property values containing / pass through YAML parameters: block to kamelet templates unencoded.

Supersedes #23391 with a source-level fix instead of decoding at the destination.

Test plan

  • KameletTest suite passes (14 tests including new encoding test)
  • CI validates camel-yaml-dsl and camel-kamelet modules
  • Verify kamelet integration tests in camel-kamelets repo no longer fail with URL-encoded content types

Claude Code on behalf of Claus Ibsen

The YAML DSL was URL-encoding kamelet parameters via
URISupport.createQueryString() (encode=true by default), but
KameletComponent uses useRawUri()=true so the encoding was never
reversed. This caused values like application/json to arrive as
application%2Fjson in kamelet templates.

Skip encoding for kamelet URIs, matching what KameletDeserializer and
YamlSupport already do with createQueryString(params, false).

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
@github-actions github-actions Bot added the dsl label Jun 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • docs
  • dsl/camel-yaml-dsl/camel-yaml-dsl
All tested modules (8 modules)
  • Camel :: JBang :: MCP
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: TUI
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: Launcher :: Container
  • Camel :: YAML DSL
  • Camel :: YAML DSL :: Validator
  • Camel :: YAML DSL :: Validator Maven Plugin

⚙️ View full build and test results

davsclaus and others added 2 commits June 22, 2026 10:40
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
@github-actions github-actions Bot added the docs label Jun 22, 2026
@davsclaus
davsclaus merged commit ea62eb6 into main Jun 22, 2026
6 checks passed
@davsclaus
davsclaus deleted the fix/CAMEL-23594 branch June 22, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants