spring-bootspring-cloud-gatewayspringdocspringdoc-ui

SpringDoc OpenAPI using "springdoc-openapi-ui" vs "springdoc-openapi-webmvc-core"


Trying to implement spring doc for my microservices at the Spring Cloud gateway level.

Came across these two dependencies. Want to know what is the difference between

"springdoc-openapi-ui" vs "springdoc-openapi-webmvc-core"

and

"springdoc-openapi-ui" vs "springdoc-openapi-ui"

Which dependency to prefer?


Solution

  • Upon checking the source code of springdoc-openapi-ui It has a maven dependency on

    <!-- springdoc-core -->
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-webmvc-core</artifactId>
            <version>${project.version}</version>
        </dependency>
    

    springdoc-openapi-ui gives both swaggerUI and json API (along with yaml format).
    springdoc-openapi-webmvc-core will only provide the swagger api alone.