davsclaus opened a new pull request, #24802:
URL: https://github.com/apache/camel/pull/24802
## Summary
_Claude Code on behalf of davsclaus_
Fixes a logic bug in `RestOpenApiEndpoint.determineEndpointParameters()`
where path parameters leak into the query string when an operation has more
than one parameter.
The inner loop was logically inverted: an endpoint parameter entry was added
to `nestedParameters` inside the inner per-operation-parameter loop whenever
*any* operation parameter did not clash, instead of only when *no* parameter
clashed. This meant the path-param filtering only worked for single-parameter
operations.
**Example:** `GET /users/{userId}/orders/{orderId}` with
`userId=1&orderId=2` would produce a request to `GET
/users/1/orders/2?userId=1&orderId=2` — the path params leaked as query params.
**Fix:** Replace the nested loop with a stream `anyMatch` check so the clash
is evaluated across all operation parameters before deciding whether to include
the entry.
Introduced in commit 94847d8c4a84 (CAMEL-17049), unfixed since 2021 due to
lack of test coverage for the multi-parameter case.
## Test plan
- [x] Added `shouldNotLeakPathParametersAsQueryParameters` — two path
params, verifies neither leaks and a non-path param is preserved
- [x] Added `shouldKeepEndpointParametersWhenNoPathParamClash` — only query
params in operation, verifies all endpoint params are preserved
- [x] All 137 existing tests pass
Co-Authored-By: Claude Opus 4.6 <[email protected]>
--
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]