Skip to content
This repository has been archived by the owner on Sep 2, 2023. It is now read-only.

*path* and *provides* (content type) details configured via Spring WebMvcConfigurer #242

Open
javornikolov opened this issue Jun 10, 2021 · 1 comment

Comments

@javornikolov
Copy link

I have implemented common prefixes for easier configuration of spring REST controllers (for controllers marked with custom annotation) via Spring WebMvcConfigurer. However in this way generateSwaggerDocumentation produces:

/my-endpoint

instead of

/my/common/api/my-endpoint

I also put the common content type in the common configuration logic and swagger docs are missing prefix now.

So far I have tried to setup prefix in swagger block but it doesn't work (complains about empty title). Might be related to fact that I use swagger via in-house plugin and configuration is probably inherited from there.

swagger {
  apiSource {
    springmvc = true
    basePath = '/my/common/api'
  }
}

Moreover - due to these differences swagger demands re-generating docs (compard to the docs before I extracted the common prefixes to common place).

Is there a way to configure swagger so that it may handle such case graefully?

@gigaSproule
Copy link
Owner

So if I've got it right, you are using a completely custom set of annotations? If so, this won't work as is, you will need to create a custom reader.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants