Skip to content

Duplicated path getting swagger-config #3294

@apozog

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.
I don't use spring-boot, I've a specific configuration class and dependency springdoc-openapi-starter-webmvc-ui:

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

And AbstractAnnotationConfigDispatcherServletInitializer sets mapping to "/api/*".

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions