davsclaus opened a new pull request, #25792:
URL: https://github.com/apache/camel/pull/25792
## Backport of #25752
Cherry-pick of #25752 onto `camel-4.22.x`.
**Original PR:** #25752 - Fix contract-first REST DSL 404 when OpenAPI base
path is root
**Original author:** @tools400
**Target branch:** `camel-4.22.x`
### Original description
RestOpenApiHelper.determineBasePath() always falls back to
DEFAULT_BASE_PATH ("/") when the OpenAPI servers[0].url has no path
segment, so the effective base path is never truly empty. In
VertxPlatformHttpConsumer.startRestServicesContractFirst(), the Vert.x
route path was built by plain concatenation of basePath + baseUrl
("/" + "/hello" -> "//hello"), which Vert.x normalizes away when
matching incoming requests, making every contract-first route
permanently unreachable whenever the contract's base path is root.
Normalize the join via a new buildNormalizedEndpoint() helper that
strips a trailing slash from the base path before concatenation, used
at both call sites (operation routes and the api-specification route).
Add regression tests covering a contract-first spec without a path
segment in servers[0].url.
Closes #25752
--
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]