swagger-api / swagger-api/swagger-codegen

Swagger codegen is not compatible with feign 10.x version

Open
#9,633 2 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

I was upgrading my application's spring boot version from 2.0.x to 2.1.x . This new version brings new version of feign (10.x). But swagger codegen maven plugin generated code is not getting compiled with with new feign version.
Further I found that swagger codegen is not generating the OAuth.java class as per 10.x version of feign and it is having compilation error.

Since Feign has changed the constructor of RetryableException class and introduced bwc, the older code is not compatible with feign's 10.x version.

Below is the new Retryable exception class:
https://github.com/OpenFeign/feign/blob/master/core/src/main/java/feign/RetryableException.java

Swagger-codegen version

3.0.8 or latest

Swagger declaration file content or url
Command line used for generation

swagger codegen maven plugin

Steps to reproduce

mvn clean install

Related issues/PRs

https://github.com/swagger-api/swagger-codegen/issues/9455

Suggest a fix/enhancement

https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/resources/Java/libraries/feign/auth/OAuth.mustache

In the above class instantiation of RetryableException should be with constructor as per 10.x version of feign.
Please let us know when this bug will be fixed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with modules/swagger-codegen/src/main/resources/Java/libraries/feign/auth/OAuth.mustache and compare its RetryableException construction with the Feign 10.x class linked in the issue. Run mvn clean install to reproduce the compilation failure. Done means generated OAuth.java compiles successfully with Feign 10.x.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.