Closed bodiam closed 4 days ago
java -jar openapi-generator-cli-6.6.0.jar generate -i http://localhost:8080/v3/api-docs -g java -o /tmp/test/java
can you also please try --library jersey2
or --library native
to see if these libraries work better with api key authentication in the query?
+1 to this bug. I did confirm that neither jersey2 nor native fixed the issue.
I see this issue too
Bug Report Checklist
Description
I have a OpenAPI spec which uses a request parameter
apikey
. This is defined as follows:(The full schema can be found here: https://gist.github.com/bodiam/d770c451e5a67629135c46261b291eac)
I have generated a Java client (and Kotlin client), and the Java client doesn't pass the query auth parameter to the endpoint. The Kotlin client, while having other issues, does send the apikey.
openapi-generator version
6.6.0
OpenAPI declaration file content or url
The problem is most likely in this piece of code:
It seems the request params (
allQueryParams
) are updated in theupdateParamsForAuth
method, and while they are, they aren't used in the request, causing the call to fail.This simple testcases reproduces it:
Generation Details
java -jar openapi-generator-cli-6.6.0.jar generate -i http://localhost:8080/v3/api-docs -g java -o /tmp/test/java
Steps to reproduce
Expected: the apikey is sent. Actual: it's not sent.
Suggest a fix
I think the requestbuilder needs to be updated with the correct request parameters.