Open polentino opened 1 year ago
bump 🙏
@polentino thanks for reporting the issue.
Would you have time to file a fix? One way to look at how Java client handle this as it should work with API keys in query and header.
Or would you like to sponsor the fix?
Bug Report Checklist
Description
I would like to give to the users of our API the possibility to choose among different types of authentication mechanisms; however, if I define
APIKeyQuery
andAPIKeyHeader
simultaneously within onesecurity
section and usescala-sttp
generator, the generated code will create a method with two identical parameterswhich will cause compilation errors:
Furthermore, as you may have noticed, there's no logic to assign the two
apiKey
parameters as header and query param.As a counter example, I tried using the
java
generator, and the codeopenapi-generator version
tested latest openapi-generator from master (but disabled openapi-generator-gradle-plugin because it causes compilation errors on my machine)
OpenAPI declaration file content or url
link to public Gist for openapi.json
Generation Details
config.yaml
:Steps to reproduce
git clone https://github.com/OpenAPITools/openapi-generator
cd openapi-generator
./mvnw clean install -Dmaven.test.skip=true -Dmaven.javadoc.skip=true
testgen
, and save openapi.json from my Gist and config.yaml in therenow you can execute
Related issues/PRs
Suggest a fix
Similar to what happens with the Java counterpart, there should be an
Authentication
object that represents the authorizations defined in the openapi spec and, when a sttpRequest
is applied to it, theAuthentication
object will enrich it with all the auth defined.