Open imod opened 6 years ago
Do you have a repo you can share. This seems like a common enough requirement.
@dilipkrish here it is: https://github.com/imod/SpringfoxSwagger-ContextPath
please let me know if there is anything I can help, it is really important for us...
@imod thank you, will research and get back to you
@dilipkrish do you get an idea how to enable this? we still struggle with this every day :(
@imod sorry been a little busy with my day job. I'll look at this shortly
@dilipkrish no worries - just wanted to know if you have any issues. really appreciate your work!
@dilipkrish just to let you know, this is still an issue we would very like to fix - do you have a pointer so I could take a look at it myself again?
What kind of issue is this?
we have the requirement to put all swagger documentation beneath a fix path. This first sounds close to an answer already given in How does one configure swagger-ui for non-springboot applications?. But the answer given there is to add some redirects to make it all work, but this is not going to work when you really only want to give explicit permission for one specific path e.g.
/documentation/**
. we don't care about the stuff after the path prefix, but it must all be beneath it - no redirects outside this path.Its the same reasoning why spring boot has
management.endpoints.web.base-path=/
to move all endpoints to a subpath. Actuator Web Endpoint PathsI have done a little experiment and have this:
This allows me to redefine the
RequestMapping
forApiResourceController
. The startup works fine, and the UI stuff can also be loaded - but unfortunate these requests fail and I have no idea how to get them to work.Also setting
springfox.documentation.swagger.v2.path=/documentation/v2/api-docs
does not help, it makes it even worse, as the it now tries to access http://localhost:8080/documentation/documentation/v2/api-docs?group=myapi