OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
When building with Feign, the generated code can not be compiled because of the missing OAuth.class on the classpath.
When in the JavaClientCodegen.java the classes OauthPasswordGrant.java and OauthClientCredentialsGrant.java get added we need also the OAuth-class to be added because the 2 mentioned classes extend this abstract-class.
This can be seen in the mustache files OauthPasswordGrant.mustache and OauthClientCredentialsGrant.mustache
openapi-generator version
the version I tested is 5.1.1
Generation Details
This codegeneration is run with following gradle-task:
Description
When building with Feign, the generated code can not be compiled because of the missing OAuth.class on the classpath.
When in the JavaClientCodegen.java the classes
OauthPasswordGrant.java
andOauthClientCredentialsGrant.java
get added we need also theOAuth
-class to be added because the 2 mentioned classes extend this abstract-class.This can be seen in the mustache files
OauthPasswordGrant.mustache
andOauthClientCredentialsGrant.mustache
openapi-generator version
the version I tested is 5.1.1
Generation Details
This codegeneration is run with following gradle-task:
execution of a build with the generated gradle.build results in a compilation error that
OAuth.class
is not found.Suggest a fix
add following line in the
javaClientCodegen
in the if-clause of Feign (if (FEIGN.equals(getLibrary()))
):supportingFiles.add(new SupportingFile("auth/OAuth.mustache", authFolder, "OAuth.java"));