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

Spring request mapping mode #13838

Merged

Conversation

cachescrubber
Copy link
Contributor

@cachescrubber cachescrubber commented Oct 27, 2022

requestMappingMode: Explicit configuration to control the location of the generated class level RequestMapping annotation

Since #10573, the @ RequestMapping has been moved from the controller to the generated api interface.
This introduced incompatibilities in many scenarios, but specially when spring-cloud is used as a library. Unfortunately the fix from @MelleD (#13546) does not allow to override the default (for example when using interfaceOnly). This PR introduces a dedicated cli option to decide where the RequestMapping annotation should be placed.

`
requestMappingMode
Where to generate the class level @RequestMapping annotation. (Default: controller)
iface - Generate the @RequestMapping annotation on the generated Api Interface.
controller - Generate the @RequestMapping annotation on the generated Api Controller Implementation.
none - Do not add a class level @RequestMapping annotation.

`

The default is controller, which is the same as before #10573. By explicitly using iface, the annotation could be added to the api interface.

Caused By

Based on

Fixes

PR checklist

  • [x ] Read the contribution guidelines.
  • [ x] 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.
  • [ x] 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 (6.1.0) (minor release - breaking changes with fallbacks), 7.0.x (breaking changes without fallbacks)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@cachescrubber
Copy link
Contributor Author

cachescrubber commented Oct 27, 2022

Note to self. IIRC, we need to restore the. useFeignClientUrl functionality introduced in #12250

@cachescrubber
Copy link
Contributor Author

@welshm (2022/02) @MelleD (2022/02) @atextor (2022/02) @manedev79 (2022/02) @javisst (2022/02) @borsch (2022/02) @banlevente (2022/02) @Zomzog (2022/09)

Please review

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.

Minor comments about naming and defaults - but looks great thanks for fixing!

bin/configs/spring-boot-oas3.yaml Outdated Show resolved Hide resolved
docs/generators/spring.md Outdated Show resolved Hide resolved
@wing328 wing328 merged commit b54299f into OpenAPITools:master Nov 1, 2022
@wing328 wing328 added this to the 6.2.1 milestone Nov 1, 2022
@cachescrubber cachescrubber deleted the spring_request_mapping_mode branch November 2, 2022 07:42
pstorch added a commit to pstorch/openapi-generator that referenced this pull request Jun 10, 2024
… the generated class level RequestMapping annotation

Based on OpenAPITools#13838 but for kotlin-spring.

Fixes OpenAPITools#18884
@pstorch pstorch mentioned this pull request Jun 10, 2024
5 tasks
wing328 pushed a commit that referenced this pull request Jun 17, 2024
… the generated class level RequestMapping annotation (#18896)

Based on #13838 but for kotlin-spring.

Fixes #18884
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