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] Fixes #5244 Include basePath @RequestMapping in Spring API template #8131

Merged
merged 4 commits into from Dec 2, 2019

Conversation

kerkhofsd
Copy link
Contributor

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.
    @bbdouglas (2017/07) @JFCote (2017/08) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01)

Description of the PR

Add @RequestMapping(value = "{{{contextPath}}}") on class level in the api.mustache template to correctly support the basePath swagger parameter.

To make this work for spring-cloud, I had to introduce a mustache variable hostWithoutBasePath and use this in the spring-cloud apiClient.mustache template.

@kerkhofsd kerkhofsd changed the title Fixes #5244 Include basePath @RequestMapping in Spring API template [Spring] Fixes #5244 Include basePath @RequestMapping in Spring API template May 3, 2018
@jawwadfarooq
Copy link

When will a new version i.e. v2.2.4 release with this fix?

@IsaacDeLaRosa
Copy link

@kerkhofsd is this going to be merged anytime soon? what is the workaround? maybe something like a openapi.openAPIPetstore.base-path:/v2 var in the spring properties file similar to https://github.com/OpenAPITools/openapi-generator/blob/6a00b2a802c688a235539c8425924ad6287b49d6/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java#L9

@mikela10000
Copy link

@kerkhofsd i would really appreciate the merge of this.
My current workaround it to put manually the path in the RestControler, but this is a temporary fix.

@RestController
@RequestMapping(path = "/api/XXX/v1")
public class MyApplicationController implements SomeApi {
}

Is this PR for swagger 3.0 version ? currently still using 2.0.

@highlysignificantbit
Copy link

Should be nice if this were fixed! Doing the same now as @mikela10000 ...

@talaviss
Copy link

talaviss commented Dec 24, 2018

When will this PR will be merged?

@shark300
Copy link

Ping

@kerkhofsd
Copy link
Contributor Author

As the creator of this PR (I'm just an open source contributor), I do not have any idea if this ever will be merged.
As everyone can see, I didn't receive any feedback and there was no effort to get this merged so far.

@sergeypavlikhin
Copy link

Is it possible to close and reopen this PR? This step will bump one

@HugoMario
Copy link
Contributor

hi @kerkhofsd , sorry for this long and no fair delay. i'm going to check your changes and merge them. Thanks !!

@HugoMario HugoMario mentioned this pull request Dec 1, 2019
4 tasks
@frantuma
Copy link
Member

frantuma commented Dec 2, 2019

please build

@HugoMario HugoMario merged commit f1569a0 into swagger-api:master Dec 2, 2019
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.

None yet

10 participants