tools400 opened a new pull request, #25752:
URL: https://github.com/apache/camel/pull/25752
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.
# Description
The merge request fixes the problem, that _Contract First_ APIs always
return 404, if no base path has been set in `servers[0].url`.
# Target
- [x] I checked that the commit is targeting the correct branch (Camel 4
uses the `main` branch)
# Tracking
- [ ] If this is a large change, bug fix, or code improvement, I checked
there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for
the change (usually before you start working on it).
# Apache Camel coding standards and style
- [x] I checked that each commit in the pull request has a meaningful
subject line and body.
- [ ] I have run `mvn clean install -DskipTests` locally from root folder
and I have committed all auto-generated changes.
# AI-assisted contributions
- [x] If this PR includes AI-generated code, commits have proper
co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR
description identifies the AI tool used.
--
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]