Skip to content

Duplicated path getting swagger-config #3294

Description

@apozog

After migrating from springdoc 2.8.9 to 3.0.3, swagger-ui started to fail because it adds an extra path to swagger-config route.
Main page "/api/swagger-ui/index.html" is loaded, but tries to get config from "/api/api/v3/api-docs/swagger-config" and fails. Notice the duplicated "/api" at the start. I've verified that the right url without the duplication is providing content correctly.

This is my springdoc.properties:

springdoc.packagesToScan=com.example
springdoc.pathsToMatch=/api/**
springdoc.api-docs.path=/api/v3/api-docs
springdoc.api-docs.enabled = true
springdoc.swagger-ui.path=/api/swagger-ui
springdoc.swagger-ui.enabled = true

Notice I've custom paths. It was working seamlessly with previous version. OpenApi doc at /api/v3/api-docs keeps working well.
My dispatcher-servlet is mapped programmatically at /api, and my controllers are at /api/* because I've WebMvcConfigurer.configurePathMatch with UrlPathHelper.setAlwaysUseFullPath(true).
I don't use spring-boot so I've a specific Springdoc configuration class and dependency springdoc-openapi-starter-webmvc-ui:

@Configuration
@ComponentScan(basePackages = { "org.springdoc" })
@Import({ SwaggerConfig.class, SwaggerWebMvcConfigurer.class, JacksonAutoConfiguration.class })
public class SwaggerUiWebMvcConfigurer {
... }
Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions