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

Comments

Projects
None yet
3 participants
@ihrankouski
Contributor

ihrankouski commented Sep 5, 2018

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

This comment has been minimized.

Show comment
Hide comment
@jmini

jmini Sep 6, 2018

Member

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.

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

This comment has been minimized.

Show comment
Hide comment
@wing328

wing328 Sep 6, 2018

Member

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.

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.

@ihrankouski ihrankouski closed this Sep 6, 2018

@ihrankouski ihrankouski reopened this Sep 6, 2018

ihrankouski added a commit to ihrankouski/openapi-generator that referenced this issue Sep 6, 2018

@ihrankouski ihrankouski referenced this issue Sep 6, 2018

Merged

[Java][Feign] Add support for Feign 10 (#977) #988

4 of 4 tasks complete

@wing328 wing328 closed this in #988 Sep 9, 2018

wing328 added a commit that referenced this issue Sep 9, 2018

@wing328 wing328 added this to the 3.3.0 milestone Sep 10, 2018

jaumard added a commit to jaumard/openapi-generator that referenced this issue Sep 21, 2018

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