davsclaus opened a new pull request, #24186:
URL: https://github.com/apache/camel/pull/24186

   ## Summary
   
   - Fix `EndpointHelper.extractParamsToKeep()` to detect `RAW({{?xxx}})` 
patterns when stripping unresolved optional property placeholders
   - When YAML DSL wraps secret parameters in `RAW()` before property 
resolution, the `{{?` optional marker is hidden inside `RAW({{?xxx}})`, so the 
stripping logic skips them
   - Add tests for optional query params in route templates and kamelets 
(including secret params)
   
   ## Root Cause
   
   `YamlSupport.createEndpointUri()` wraps secret parameter values in `RAW()` 
**before** property placeholder resolution. An unprovided optional param like 
`{{?accessKey}}` becomes `RAW({{?accessKey}})`. Then 
`EndpointHelper.extractParamsToKeep()` checks if values start with `{{?` — but 
`RAW(`-prefixed values don't match, so they survive the filter and remain in 
the endpoint URI as invalid parameters.
   
   ## Fix
   
   In `extractParamsToKeep()`, unwrap `RAW(...)` before checking for the `{{?` 
optional prefix. This is a 5-line addition.
   
   ## Test plan
   
   - [x] `RouteTemplateOptionalValueTest` — 3 new tests for multiple optional 
query params (none/some/all provided)
   - [x] `KameletOptionalParameterTest` — new test class with 5 tests:
     - 3 log-sink tests (non-secret optional params — these already worked)
     - 1 AWS S3 test with secret optional params NOT provided (was broken, now 
fixed)
     - 1 AWS S3 test with secret optional params provided (regression check)
   - [x] Existing `OptionalPropertyPlaceholderTest` (9 tests) still passes
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code) on behalf of 
Claus Ibsen


-- 
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]

Reply via email to