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

Enable code generation for OpenFeign with Spring-Boot 2 (#9118) #9120

Conversation

unmerge
Copy link

@unmerge unmerge commented Jan 25, 2019

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: 3.0.0 branch for changes related to OpenAPI spec 3.0. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.
    @davidkiss

Description of the PR

#9118 [JAVA] Enable code generation for OpenFeign with Spring-Boot 2

When using generation library spring-cloud, code will be generated with import:

import org.springframework.cloud.netflix.feign.FeignClient;

But when one wants to use open feign with spring boot 2, we need the following:

import org.springframework.cloud.openfeign.FeignClient;

Solution: Setup property to switch between both import statements (JavaSpring library spring-cloud) -> apiClient.mustache.

@unmerge unmerge changed the title issue-9118_Enable_code_generation_for_openfeign_with_spring-boot_2 Enable code generation for OpenFeign with Spring-Boot 2 Feb 6, 2019
@unmerge unmerge changed the title Enable code generation for OpenFeign with Spring-Boot 2 Enable code generation for OpenFeign with Spring-Boot 2 (#9118) Feb 6, 2019
@HugoMario
Copy link
Contributor

thanks a lot @unmerge

@HugoMario HugoMario merged commit 5358d44 into swagger-api:master Mar 6, 2019
@chrisplyn
Copy link

chrisplyn commented Mar 14, 2020

@HugoMario Hi Hugo, I am still having trouble generating feign client with spring 2, can you describe a little bit how to use this feature?

@HugoMario
Copy link
Contributor

hey @chrisplyn, sorry for delay. Can you please share more details about the errors you got?

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

Successfully merging this pull request may close these issues.

3 participants