cunningt opened a new pull request, #23391: URL: https://github.com/apache/camel/pull/23391
## Problem Kamelet integration tests were failing due to two property resolution issues: 1. **Trailing whitespace in property values** — YAML literal block scalars (`|`) preserve trailing newlines, which cause `URISyntaxException` when the property value is resolved into an endpoint URI string. 2. **URL-encoded property values** — The YAML DSL uses `URISupport.createQueryString()` to build kamelet URIs, which URL-encodes property values (e.g., `application/json` → `application%2Fjson`). Since `KameletComponent` uses `useRawUri()=true` to preserve sensitive values, automatic URL-decoding during URI parsing is skipped, leaving encoded values like `application%2Fjson` to be passed to kamelet templates. ## Solution ### Fix 1: Trim whitespace in DefaultPropertiesParser **File:** `core/camel-base/src/main/java/org/apache/camel/component/properties/DefaultPropertiesParser.java` Added `.trim()` when returning resolved property values in `doGetPropertyValue()`. This strips leading/trailing whitespace, which is safe since no legitimate property value depends on surrounding whitespace. ### Fix 2: URL-decode kamelet parameters **File:** `components/camel-kamelet/src/main/java/org/apache/camel/component/kamelet/KameletComponent.java` Added URL-decoding for non-RAW string parameter values in `createEndpoint()`, between extraction and RAW resolution. This reverses the encoding done by `URISupport.createQueryString()` while preserving RAW-wrapped sensitive values (which use `RAW()` syntax and skip URL encoding). ## Testing - ✅ All 91 property component tests pass (`org.apache.camel.component.properties.*Test`) - ✅ All 81 kamelet component tests pass - ✅ All 337 YAML DSL tests pass These fixes resolve kamelet integration test failures where: - Property values with trailing newlines caused `URISyntaxException` - URL-encoded values like `application%2Fjson` were incorrectly passed as `Content-Type` headers, causing HTTP 415 errors ## Related Issues CAMEL-23594 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
