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

   https://issues.apache.org/jira/browse/CAMEL-25383
   
   `EndpointUriFactorySupport.buildPathParameter` fills the path parameters one 
by one, in syntax order, and removes an unset optional one from the uri by its 
name. `indexOfPathParameter` searched for that name starting after the scheme, 
so it could find the name inside the value of a path parameter already 
substituted. It then cut the name out, plus one separator before it.
   
   ```
   acme2:name/path:port   with name = {{path}}   ->  acme2:{}}/path   (was)
                                                  ->  acme2:{{path}}   (now)
   ```
   
   Found with `azure-files` (`azure-files://account/share:port/directoryName`): 
`share: "{{shareName}}/{{directoryName}}"` came out as 
`azure-files:{{accountName}}/{{shareName}}/{}}`. This was while normalizing the 
camel-kamelets catalog (CAMEL-25381).
   
   **Fix:** `indexOfPathParameter` takes the last word match after the scheme. 
The values of the parameters before this one come before its name in the uri, 
and the syntax's own name comes after them, so the last match is always the 
syntax's.
   
   **Tests:**
   - 
`CustomEndpointUriFactoryTest.testValueWithTheNameOfAnUnsetOptionalPathParameter`
 covers a placeholder value, a plain value containing the words, and a value 
followed by a set optional parameter. It fails without the change.
   - camel-core endpoint and uri factory tests pass (454), as do camel-support 
(125) and camel-yaml-dsl (458), which builds uris from `parameters:` through 
these factories.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m


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