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
Compilation fails for the Java/Feign generator when Feign 13 and above are used. The reason is version 13 adds an overload to the RetryableException constructor with type Long instead of Date, and the value is passed as null causing the compiler to fail to with following message:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile (default-compile) on project swagger-petstore-feign: Compilation failure
[ERROR] /Users/lucas.santos/work/code/swagger-codegen/samples/client/petstore/java/feign/src/main/java/io/swagger/client/auth/OAuth.java:[96,19] reference to RetryableException is ambiguous
[ERROR] both constructor RetryableException(int,java.lang.String,feign.Request.HttpMethod,java.lang.Throwable,java.lang.Long,feign.Request) in feign.RetryableException and constructor RetryableException(int,java.lang.String,feign.Request.HttpMethod,java.lang.Throwable,java.util.Date,feign.Request) in feign.RetryableException match
Description
The solution is simple, in this line:
thrownewRetryableException(400, e.getMessage(), template.request().httpMethod(), e, null, template.request());
the type of the 5th parameter must be explicitly specified:
thrownewRetryableException(400, e.getMessage(), template.request().httpMethod(), e, (Date) null, template.request());
This solution continues to use the deprecated version but keeps the generator compatible with versions that were already previously supported.
I'll submit a Merge Request
The text was updated successfully, but these errors were encountered:
Description
Compilation fails for the Java/Feign generator when Feign 13 and above are used. The reason is version 13 adds an overload to the RetryableException constructor with type Long instead of Date, and the value is passed as
null
causing the compiler to fail to with following message:Description
The solution is simple, in this line:
the type of the 5th parameter must be explicitly specified:
This solution continues to use the deprecated version but keeps the generator compatible with versions that were already previously supported.
I'll submit a Merge Request
The text was updated successfully, but these errors were encountered: