Skip to content

springdoc-openapi-webflux-ui 2.0.0-M7 + spring actuator + spring cloud crashes at startup  #1904

Closed
@magnus-larsson

Description

@magnus-larsson

Describe the bug
This seems related to issues #1607 and #1617, maybe a remaining corner case?

If the following configuration is used, the application fails to start:

management.endpoints.web.exposure.include: "*"

The error message is the same as in #1607 and #1617:

***************************
APPLICATION FAILED TO START
***************************

Description:

Parameter 0 of method webConversionServiceProvider in org.springdoc.core.configuration.SpringDocConfiguration$WebConversionServiceConfiguration required a single bean, but 2 were found:
        - webFluxConversionService: defined by method 'webFluxConversionService' in class path resource [org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfiguration$EnableWebFluxConfiguration.class]
        - integrationConversionService: defined in null

The following versions are used:

  1. Spring Boot v3.0.0-RC1
  2. Spring Cloud v2022.0.0-M5
  3. springdoc-openapi-starter-webflux-ui v2.0.0-M7

Sample
product-composite-service.zip

To Reproduce
Steps to reproduce the behavior:

  1. Unzip the attached sample code.

  2. Build and start the server with: ./gradlew clean test bootRun

  3. Run the following curl commands to verify it works as expcted:

    curl localhost:7000/api -so /dev/null -w "%{http_code}\n"
    curl localhost:7000/openapi/swagger-ui.html -Lso /dev/null -w "%{http_code}\n"
    curl localhost:7000/openapi/webjars/swagger-ui/index.html -so /dev/null -w "%{http_code}\n"
    curl localhost:7000/openapi/v3/api-docs -so /dev/null -w "%{http_code}\n"
    curl localhost:7000/openapi/v3/api-docs.yaml -so /dev/null -w "%{http_code}\n"
    

    Expect them all to return 200.

  4. Stop the application

  5. Edit src/main/resources/application.yml and remove the comment mark before:

    management.endpoints.web.exposure.include: "*"
    
  6. Start the application again and it will now fail with the error message shown above.

Expected behavior
That the application starts up normally and the curl commands mentioned above all return 200, when using the setting management.endpoints.web.exposure.include: "*".

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