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

   Fixes [CAMEL-25110](https://issues.apache.org/jira/browse/CAMEL-25110): bugs 
found in a deep review of the property placeholder parser 
(`DefaultPropertiesParser`).
   
   ## Fixed
   1. **The documented optional form `{{env:?KEY}}` always returned null** for 
functions that do not look up the property first (env, sys, service, bean, and 
the vault and kubernetes functions), even when the value exists. The function 
was called with a key that still included the `?`.
   2. **The optional marker on the key of a function, `{{?env:KEY}}`, was 
ignored**, so a missing value failed.
   3. **With `ignoreMissingProperty=true`, the internal marker `@@[key]@@` was 
returned** instead of the unresolved placeholder `{{key}}`. This affected 
`CamelContext.resolvePropertyPlaceholders`, which the model and property 
binding use.
   4. **A resolved value ending with a backslash escaped the next 
placeholder.** For example, with the Windows path `dir=C:\temp\`, 
`{{dir}}{{file}}` failed with `Missing {{ from the text: C:\temp\{{file}}`. The 
resolved value was parsed again; now parsing continues after it.
   5. **With `nestedPlaceholder=false`, the text before an unresolved optional 
placeholder was dropped.** `abc{{?x}}def` gave `def`.
   6. **With `nestedPlaceholder=false`, an escaped backslash before a 
placeholder (`\\{{key}}`) was not restored** to a single backslash, as 
documented.
   7. **The `?nested=true|false` option was removed from anywhere in the 
text**, such as a query parameter of an endpoint URI, instead of only from the 
key of a placeholder.
   
   ## Not changed
   - The resolved value reported for a key (dev console, summary) may be 
recorded for the wrong key when nested placeholders or functions are used.
   - Default values are resolved before the key, so a default that contains a 
missing placeholder fails even when the key exists.
   
   ## Tests
   - **New `PropertiesParserEdgeCasesTest`:** all 6 tests fail without the fix.
   - **Full suites:** camel-core, camel-main and their upstream modules pass.
   
   _Claude Code on behalf of Claus Ibsen_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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