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

Remove wrong request mapping for feign clients #13546

Conversation

MelleD
Copy link
Contributor

@MelleD MelleD commented Sep 28, 2022

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

Copy link
Contributor

@welshm welshm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@@ -491,6 +493,8 @@ public void processOpts() {
additionalProperties.put(SINGLE_CONTENT_TYPES, "true");
this.setSingleContentTypes(true);
}
additionalProperties.put(USE_FEIGN_CLIENT, "true");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I guess this didn't exist, it just relied on importing the correct apiClient.mustache instead

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes correct

@welshm
Copy link
Contributor

welshm commented Oct 6, 2022

@MelleD do you think this is good to merge? The Feing issue is gaining more traction, would be nice to get a fix in the next patch release 🙏

@MelleD
Copy link
Contributor Author

MelleD commented Oct 6, 2022

@MelleD do you think this is good to merge? The Feing issue is gaining more traction, would be nice to get a fix in the next patch release 🙏

Yes for me it’s finish and mergeable

@welshm
Copy link
Contributor

welshm commented Oct 6, 2022

@wing328 I think this is good to go, probably fixes some of the Feign issues

@wing328 wing328 added this to the 6.2.1 milestone Oct 6, 2022
@wing328 wing328 merged commit 0a69f11 into OpenAPITools:master Oct 6, 2022
jayandran-Sampath pushed a commit to jayandran-Sampath/openapi-generator that referenced this pull request Oct 6, 2022
* Remove request mapping

* Fix bug for feign clients

* Fix test

* Fix test files

* Rebuild

* Revert change
@MelleD MelleD deleted the bugfix-13488-remove-request-mapping-for-spring-cloud branch October 7, 2022 06:28
@cachescrubber
Copy link
Contributor

@MelleD I just stumbled upon the @RequestMapping issue. IIRC especially when using the spring-cloud feign client, one should not annotate the interface with the @RequestMapping annotation. See spring-cloud/spring-cloud-netflix#466. But the useFeignClient option as in this PR would activate the annotation, right?

@cachescrubber
Copy link
Contributor

Sorry @MelleD, the logic behind useFeignClient seems right.

I still have breaking builds where interfaceOnly is used. There is currently no way to disable the @RequestMapping Annotation in this scenario. Hmm. Would't it be better to opt-in for @RequestMapping in the interface?

@cachescrubber cachescrubber mentioned this pull request Oct 27, 2022
2 tasks
@gorefest
Copy link

@cachescrubber with 6.2.1 a regression has been brought into the spring generator. It now - again - places @NotNull validations even with useBeanValidation=false and - worse - it forgets to add the import into the generated interface

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

Successfully merging this pull request may close these issues.

5 participants