Skip to content

Springdoc-openapi-webmvc-core not enought for Springdoc-openapi-native  #1442

Closed
@JulienHoullier

Description

@JulienHoullier

Describe the bug
When only using the Springdoc-openapi-webmvc-core and adding Springdoc-openapi-native, the application fails to start since SpringDocHints expect a bean SwaggerUiConfigProperties why is i guess provided by auto-configuration in springdoc-openapi-ui

To Reproduce
Steps to reproduce the behavior:

  • Create a Spring Boot Native APP (Spring boot 2.6.2 + Spring Native 0.11.1) using Spring Initialzer
  • Add module springdoc-openapi-webmvc-core and springdoc-openapi-native 1.6.3
  • Activate springdoc.api-docs.enabled=true
  • Error printed

Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springdoc.nativex.core.SpringDocHints': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springdoc.core.SwaggerUiConfigProperties' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}

Expected behavior

  • No error

Workaround

  • Add the expected bean in your application:
    @Bean public SwaggerUiConfigProperties swaggerUiConfigProperties() { return new SwaggerUiConfigProperties(); }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions