-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG][Java] isBasicBearer not used in default template #4178
Comments
@tpeyrard would you like to file a PR to fix this? |
If that's really a "bug" / "missing feature", then yes I'd be happy to file a PR.
Are you ok to say it should use the `isBasicBearer` for the Bearer authentication?
|
looking at other templates like e.g. openapi-generator/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache Lines 109 to 126 in c2ad14e
it seems {{#isBasicBearer}} is correct
|
however, looking at the code openapi-generator/modules/openapi-generator/src/main/resources/Java/ApiClient.mustache Lines 106 to 108 in 7ab73ff
the line {{^isBasicBasic}}
authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}} should be added if basic-bearer authentication is enabled, since |
Ok, thanks. |
So I tried to "fix" it but there is nothing to fix in fact. So either I leave the code as-is, or I change it to use the wdyt? |
i think isBasicBearer is more future-proof |
Sorry i hadn't seen this defect. I fixed it since we needed for for our purpose. I created a PR with the fix. |
Thanks I didn't have time this week to work on it.
|
Bug Report Checklist
Description
Generating the code with the default Java template, it seems the new added
isBasicBearer
is not used:openapi-generator/modules/openapi-generator/src/main/resources/Java/ApiClient.mustache
Lines 106 to 108 in 7ab73ff
The Bearer part is defined inside the
isBasicBasic
. I thought it would be within theisBasicBearer
.openapi-generator version
4.1.3
OpenAPI declaration file content or url
Although the problem is at the template level, not the code generation I think, here is the link to the OpenAPI spec:
https://api.criteo.com/marketing/swagger/docs/v.1.0
Command line used for generation
https://github.com/criteo/criteo-marketing-sdk-generator/blob/master/build-java/build.gradle#L66-L93
Thanks :)
The text was updated successfully, but these errors were encountered: