Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java Feign template doesn't work with Feign 10 #977

Closed
ihrankouski opened this issue Sep 5, 2018 · 2 comments
Closed

Java Feign template doesn't work with Feign 10 #977

ihrankouski opened this issue Sep 5, 2018 · 2 comments

Comments

@ihrankouski
Copy link
Contributor

Hello,

Currently Java Feign template generates code for Feign 9.4.0.
I'd like the generated client to work with Feign 10.0.1 since I already use that version in my project.
However that not possible currently because of breaking change in Feign:

#744 [Core] Added HttpMethod to RetryableException

https://github.com/OpenFeign/feign/pull/744/files#diff-64c69768b214213c25fd1246bae90adaR33 - RetryableException constructor wants HTTP method now.

Looks like it's only thrown here in this file: https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/OAuth.mustache#L95

So I had to overwrite original template with my own to generate working code right now.

But is it possible to update the template to support newer Feign out of box?

@jmini
Copy link
Member

jmini commented Sep 6, 2018

But is it possible to update the template to support newer Feign out of box?

Yes feel free to file a pull request for that.

Please also update the corresponding dependencies for the generated pom.xml:

<feign-version>9.4.0</feign-version>
<feign-form-version>2.1.0</feign-form-version>

the generated gradle file:

feign_version = "9.4.0"
feign_form_version = "2.1.0"

and the generated sbt file:

"io.github.openfeign" % "feign-core" % "9.4.0" % "compile",
"io.github.openfeign" % "feign-jackson" % "9.4.0" % "compile",
"io.github.openfeign" % "feign-slf4j" % "9.4.0" % "compile",
"io.github.openfeign.form" % "feign-form" % "2.1.0" % "compile",

Thank you in advance, do not hesitate to ping us if you need help with something.

@wing328
Copy link
Member

wing328 commented Sep 6, 2018

For this one, I suggest we add an option "feignOption" to allow users setting the Feign version: 9.x, 10.x, with the following mustache tags:

{{#isFeign10}} ... {{/isFeign10}}

{{#isFeign9}} ... {{/isFeign9}}

Please let me know if you need help on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants