Skip to content

Warning messages when docs are explicitly enabled #3131

@robertsez

Description

@robertsez

Describe the bug

It does not make any sense for these warning log messages if the documentation endpoints are explicitly enabled.

2025-11-06T15:09:10.023+02:00  WARN 37255 --- [users-service] [  restartedMain] [                                                 ] o.s.core.events.SpringDocAppInitializer  : SpringDoc /v3/api-docs endpoint is enabled by default. To disable it in production, set the property 'springdoc.api-docs.enabled=false'
2025-11-06T15:09:10.023+02:00  WARN 37255 --- [users-service] [  restartedMain] [                                                 ] o.s.core.events.SpringDocAppInitializer  : SpringDoc /docs endpoint is enabled by default. To disable it in production, set the property 'springdoc.swagger-ui.enabled=false'

To Reproduce

springdoc:
  api-docs:
    enabled: true
  swagger-ui:
    enabled: true

Spring Boot: 4.0.0-RC1
springdoc-openapi-starter-webmvc-ui: 3.0.0-RC1

Expected behavior

If the features are explicitly enabled, there should not be any warning logs. If you decide to keep it like this, at least change the wording, since "enabled by default" is not accurate in this scenario and may cause confusion. In my use case, I explicitly disable everything in the base application.yml and then override these properties in dev-application.yml to only enable them in the development environment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis doesn't seem right

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions