Skip to content

[Spring] Set basePath on Spring Api Interface @RequestMapping#7014

Open
patst wants to merge 5 commits intoOpenAPITools:masterfrom
patst:master
Open

[Spring] Set basePath on Spring Api Interface @RequestMapping#7014
patst wants to merge 5 commits intoOpenAPITools:masterfrom
patst:master

Conversation

@patst
Copy link
Copy Markdown
Contributor

@patst patst commented Jul 22, 2020

Fix #1928

The base-path should be set on the Api interface. This way it is working with interfaceOnly.
I removed it from the apiController.mustachefile and added it to the api.mustache file.

Tested locally with an example project.

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project beforehand.
  • Run the shell script ./bin/generate-samples.shto update all Petstore samples related to your fix. 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
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

@bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) @bkabrda (2020/01)

Comment on lines +70 to +72
{{#-}}
{{>requestMapping}}
{{/-}}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The requestMapping is never generated on the API level with this condition.
I'm not sure to understand why using {{#-}} condition to generate it.

@@ -0,0 +1,3 @@
{{=<% %>=}}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's the same one for spring-boot and spring-mvc, maybe it can be the default value of the spring generator and override only for spring-cloud?

@tunglt1810
Copy link
Copy Markdown

plzzz merge this PR

@sarndt
Copy link
Copy Markdown

sarndt commented Feb 25, 2021

Is there anything preventing this from being merged in? There's a few tests failing, can these be solved? I'm currently stumbling over this issue.

@mpgirro
Copy link
Copy Markdown

mpgirro commented Sep 19, 2021

I'm also experiencing this issue right now. Please resolve the open topics and merge this request. Would be awesome to see this in the next release!

Thanks! 😊

@sesamzoo
Copy link
Copy Markdown

Seems to be obsolete since #10573.

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.

[Spring] Generated controllers ignore basePath

6 participants