0

I have a spring boot application which is located behind a reverse proxy. This proxy rewrites paths. In my application I have a REST controller and document it with springdoc

@Operation(summary = "Expose some data", ...)
@RequestMapping(path = "/a", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
public MyDto getA() {

The springdoc / OpenAPI generation leads to an operation reachable at /a However the reverse proxy makes it available at /b

How can I tell springdoc that it should not use the introspected path from the @RequestMapping annotation but instead pass a path to any springdoc annotation?

Thanks.

Telamon
  • 46
  • 3
  • Did you refer the document at https://springdoc.org/index.html#how-can-i-deploy-springdoc-openapi-ui-behind-a-reverse-proxy – Debargha Roy Apr 29 '21 at 17:06
  • No, my question is about the REST services, not the springdoc-openapi-ui. The UI works exactly as stated in the doc. However there is no documentation about how to specify a different path for the REST services. – Telamon Apr 30 '21 at 04:59
  • `how to specify a different path for the REST services` can you elaborate on this? – Debargha Roy May 06 '21 at 17:18
  • I realized this now through implementing a OpenApiCustomiser. However this is quite cumbersome. It would really be helpful if there is a direct framework support, e. g. through an attribute in one of the annotations of Springdoc. – Telamon May 10 '21 at 07:10
  • Try raising an issue at https://github.com/springdoc/springdoc-openapi/issues – Debargha Roy May 10 '21 at 11:05

0 Answers0