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
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
I am trying to generate a Java client (feign library) for an Open API spec using OAuth via openapi-generator-maven-plugin, version 6.0.0. The token URL contains parameters, e.g. https:/auth-server/token?key=value. The generator HTML-escapes the URL, resulting in https:/auth-server/token?key=value.
The generated client cannot authenticate, because the token URL is corrupted.
openapi-generator version
openapi-generator-maven-plugin, version 6.0.0
also occurs with version, 5.4.0
define an Open API spec with OAuth token URL containing URL parameters
generate client using maven plugin
Suggest a fix
HTML-escaping the token / authorization URL is not correct. It should be avoided by fixing the corresponding Mustache template. The token URL and the authorization URL must not be HTML-escaped. This can be done by using {{{ to refer to the variables. basePath is referenced correctly in the Java-Feign template. See modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache
As a workaround, I added a fixed version of the java-feign template and set it up in the maven plugin configuration: <templateDirectory>src/main/open-api/templates</templateDirectory>
The text was updated successfully, but these errors were encountered:
Bug Report Checklist
Description
I am trying to generate a Java client (feign library) for an Open API spec using OAuth via openapi-generator-maven-plugin, version 6.0.0. The token URL contains parameters, e.g.
https:/auth-server/token?key=value
. The generator HTML-escapes the URL, resulting inhttps:/auth-server/token?key=value
.The generated client cannot authenticate, because the token URL is corrupted.
openapi-generator version
openapi-generator-maven-plugin, version 6.0.0
also occurs with version, 5.4.0
OpenAPI declaration file content or url
The spec contains the following securityScheme:
Generation Details
When using
mvn generate-sources
, the generated client contains an invalid token URL.The maven build file configures the plugin:
Steps to reproduce
Suggest a fix
HTML-escaping the token / authorization URL is not correct. It should be avoided by fixing the corresponding Mustache template. The token URL and the authorization URL must not be HTML-escaped. This can be done by using
{{{
to refer to the variables.basePath
is referenced correctly in the Java-Feign template. Seemodules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache
As a workaround, I added a fixed version of the java-feign template and set it up in the maven plugin configuration:
<templateDirectory>src/main/open-api/templates</templateDirectory>
The text was updated successfully, but these errors were encountered: