0

I'm using springdoc-openapi 1.6.11 and I'm finding that nested endpoints in my Controllers are not being picked up in the Swagger docs.

For example, the controller is annotated with@RequestMapping("/a/patient").

Then I'll have a method inside the controller such as: @PutMapping("profile/height")

But the generated Swagger isn't picking it up.

My Config class looks like this:

@Configuration
public class OpenApiConfig {

    @Bean
    public OpenAPI springOpenAPI() {
        return new OpenAPI()
                .info(new Info().title("BubbleCare API")
                .description("BubbleCare service documentation.")
                .version(getClass().getPackage().getImplementationVersion())
                .license(new License().name("Terms of Use")
                .url("https://myapi.com/terms.html")));
    }

and my properties look like this:

springdoc.cache.disabled= true
springdoc.pathsToMatch=/a/**,/d/**
springdoc.swagger-ui.operationsSorter=alpha

I don't know why, I'll be coding for a while, and everything seems okay, but then the Swagger generation just happens to freeze and not want to update any new endpoints that I write.

Any ideas?

João Dias
  • 16,277
  • 6
  • 33
  • 45
Kash.
  • 242
  • 1
  • 3
  • 15

1 Answers1

0

Everything looks fine to me. There might be a chance that your dependencies got mucked up, you can try purging the local maven repository using below command:

mvn dependency:purge-local-repository

Then you can clean and install again for your project:

mvn dependency:purge-local-repository clean install

You can learn more about this command here: https://maven.apache.org/plugins/maven-dependency-plugin/examples/purging-local-repository.html