-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Support for multiple endpoints with the same paths that rely on @RequestMapping.param #1874
Comments
Swagger spec does not allow multiple endpoints that differ by request params. However you could use the experimental feature to get around it using |
@dilipkrish Thanks a lot! This feature does solve my problem. Even though, I feel that |
BTW since it's an experimental feature, can I rely on it being there in the future releases or it's still undecided? |
And FYI there is no 2.7.0 of io.springfox:springfox-staticdocs which I would have expected to be there along with other deps. |
@ilya40umov Its experimental because swagger 2.0 does not support it officially. Will see how that translates to OAS 3.0. But for sure there will be support for it in springfox o/w much of the features people rely on will be unavailable via the specification. Regarding staticdocs, its not supported any more because there is no point in supporting an older version of swagger2markup. Its easier to use the latest version directly. |
Hi @dilipkrish, I have the same use case here. My problem now: I'd expect that it just adds the param like this: |
@Aliceice Thats because you're using an incorrect version of swagger-ui. |
@dilipkrish Thanks for the quick reply!
It seems like it's not being picked up by spring. |
You need to refresh your browser cache as well |
Thanks a lot ! |
Could you please merge this into master? |
hi,can you tell me how to fix it ? |
I'm currently on version 2.6.1 and facing a problem with Swagger UI essentially swallowing all but one Spring REST endpoints that share the same path.
E.g.
This configuration is telling Spring MVC to call one of two methods depending on which parameter is present in the request URL.
However, Springfox's
swagger-ui.html
shows only one of the two endpoints. (Moreover, which one of the two will be shown keeps changing from run to run).I have debugged the code somewhat and this behavior seems to be caused by putting everything into a map inside
ServiceModelToSwagger2Mapper.mapApiListings
method.So, I can see two possible solutions for this problem:
@ApiOperation
annotation, so that API developers can fix such cases on their own.P.S. I know I could kind of work around this problem by using
@ApiImplicitParams
but that would mean polluting my code with extra redundant information which I really want to avoid.The text was updated successfully, but these errors were encountered: