[ 
https://issues.apache.org/jira/browse/CAMEL-24825?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18118367#comment-18118367
 ] 

Guillaume Nodet commented on CAMEL-24825:
-----------------------------------------

This issue is being investigated by a coding agent (on behalf of gnodet).

Code analysis confirms the bug is real: when the OpenAPI spec has no servers 
entry (or an empty servers list), the base path resolution in 
camel-rest-openapi fails with a JDK-level "URI is not absolute" exception. The 
fix involves adding a null/empty guard for the servers list at the 
specification-load or consumer-creation boundary, similar to the approach in 
closed PR #26755 (which addressed a related sub-issue but was not merged).

_Note: This comment was generated by an AI coding agent and requires manual 
verification._

> REST DSL from an OpenAPI contract with no servers entry fails to start with 
> "URI is not absolute"
> -------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-24825
>                 URL: https://issues.apache.org/jira/browse/CAMEL-24825
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-rest-openapi
>            Reporter: Claus Ibsen
>            Assignee: Guillaume Nodet
>            Priority: Major
>
> With a contract whose servers entry is {"url": "http://localhost:8080"} (no 
> path), Camel 4.22.0 logs the operations in the HTTP endpoints summary 
> (/stock, /stock/{sku}, ...) but every request to them answers 404 with the 
> platform-http "Resource not found" page. With {"url": 
> "http://localhost:8080/api"} the same contract works. The 4.23.0-SNAPSHOT of 
> 2026-09-18 serves the path-less form correctly.
> Found while writing the openapi-server example for CAMEL-24808 (the example 
> now uses /api, see camel-jbang-examples issue 86). Without a servers entry at 
> all, 4.22.0 fails to start with "URI is not absolute".
> Two things to do: find the change between 4.22.0 and main that fixed the 
> path-less form and backport it to 4.22.x if it is small; and make a missing 
> servers entry a clear error (or default to "/") instead of "URI is not 
> absolute".



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to