You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have you searched for related issues/PRs? — Yes and I did not find anything relevant.
What's the actual output vs expected output? — See the reproducer project at and its README.md
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
See the diff in the reproducer project at https://github.com/wilx/inputSpecRootDirectory-issue#. The issue manifests as missing authentication schemas in the ApiClient.java when the Maven plugin is using inputSpecRootDirectory. The difference is this:
--- ./using-inputSpec/target/generated-sources/openapi/src/main/java/com/example/ApiClient.java 2025-04-23 11:07:03.367877854 +0200+++ ./using-inputSpecRootDirectory/target/generated-sources/openapi/src/main/java/com/example/ApiClient.java 2025-04-23 11:07:04.889861008 +0200@@ -1,6 +1,6 @@
/*
- * Minimal Bearer Auth API- * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)+ * merged spec+ * merged spec
*
* The version of the OpenAPI document: 1.0.0
*
@@ -58,16 +58,7 @@ public class ApiClient {
public ApiClient(String[] authNames) {
this();
for(String authName : authNames) {
- Interceptor auth = null;- if ("bearerAuth".equals(authName)) {-- auth = new HttpBearerAuth("bearer");- } else {- throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names");- }- if (auth != null) {- addAuthorization(authName, auth);- }+ throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names");
}
}
@@ -103,7 +94,7 @@ public class ApiClient {
public void createDefaultAdapter() {
json = new JSON();
- String baseUrl = "https://api.example.com/v1";+ String baseUrl = "http://localhost:8080";
if (!baseUrl.endsWith("/"))
baseUrl = baseUrl + "/";
openapi-generator version
7.12.0
OpenAPI declaration file content or url
The same file that is in the reproducer project. The issue is not the YAML itself.
openapi: 3.0.3info:
title: Minimal Bearer Auth APIversion: 1.0.0servers:
- url: https://api.example.com/v1components:
securitySchemes:
bearerAuth:
type: httpscheme: bearerbearerFormat: JWTsecurity:
- bearerAuth: []paths:
/user/profile:
get:
summary: Get user profiledescription: Retrieve profile information for the authenticated user.responses:
'204':
description: Successful response
Generation Details
Just run mvn clean install in the reproducer project root.
Steps to reproduce
See above. The difference is in the inputSpecRootDirectory vs inputSpec.
Related issues/PRs
🙅🏿
Suggest a fix
🤷♂
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Bug Report Checklist
Description
See the diff in the reproducer project at https://github.com/wilx/inputSpecRootDirectory-issue#. The issue manifests as missing authentication schemas in the
ApiClient.java
when the Maven plugin is usinginputSpecRootDirectory
. The difference is this:openapi-generator version
7.12.0
OpenAPI declaration file content or url
The same file that is in the reproducer project. The issue is not the YAML itself.
Generation Details
Just run
mvn clean install
in the reproducer project root.Steps to reproduce
See above. The difference is in the
inputSpecRootDirectory
vsinputSpec
.Related issues/PRs
🙅🏿
Suggest a fix
🤷♂
The text was updated successfully, but these errors were encountered: