gnodet-bot commented on code in PR #26765:
URL: https://github.com/apache/camel/pull/26765#discussion_r4081067032


##########
components/camel-rest-openapi/src/main/java/org/apache/camel/component/rest/openapi/RestOpenApiEndpoint.java:
##########
@@ -627,9 +627,11 @@ String determineBasePath(final OpenAPI openapi) {
             return restConfigurationBasePath;
         }
 
-        final String specificationBasePath = 
RestOpenApiHelper.getBasePathFromOpenApi(openapi);
-        if (isNotEmpty(specificationBasePath)) {
-            return specificationBasePath;
+        if (openapi != null) {
+            final String specificationBasePath = 
RestOpenApiHelper.getBasePathFromOpenApi(openapi);
+            if (isNotEmpty(specificationBasePath)) {

Review Comment:
   ⚠️ **Dead code guard**: `loadSpecificationFrom` (the only caller path) never 
returns `null` — it either returns a valid `OpenAPI` or throws 
`IllegalArgumentException`. This guard cannot be exercised by any existing 
caller.
   
   If you have a concrete scenario where `openapi` is `null` here, please add a 
test that demonstrates it. Without a test, this is a silent correctness risk: a 
future caller that mistakenly passes `null` will silently get 
`DEFAULT_BASE_PATH` instead of a helpful NPE.



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