Skip to content

Enable /actuator/openapi endpoint without requiring a different management port #3223

@pdjohe

Description

@pdjohe

Is your feature request related to a problem? Please describe.

  • The actuator endpoints are only available if the management port is different.

Describe the solution you'd like

  • Simply include the relevant API starter (either MVC or WebFlux) and configure management.endpoints.web.exposure.include=openapi to expose the openapi document endpoint (either only the application's openapi spec, or both the application's API and actuator API if springdoc.show-actuator=true).
  • The current requirement of having a different management port for actuator endpoints is counter-intuitive and not how actuator endpoints are normally configured (I believe the @ConditionalOnEnabledEndpoint("openapi") can be leveraged to start up the actuator endpoints and other beans for actuator when required, and then @ConditionalOnMissingBean to fallback if actuator endpoints aren't enabled)
  • These same above points should be applicable for /actuator/swagger-ui too, only needing to add swagger-ui to the management.endpoints.web.exposure.include list.

Describe alternatives you've considered

  • I have tried copying and pasting OpenApiActuatorResource bean definition code into my project, and then set springdoc.enable-default-api-docs=false. The API works, but the swagger-ui isn't working.
  • I also tried to set springdoc.api-docs.path=/actuator/openapibut the endpoint is not included in the actuator discovery endpoint response (/actuator) or other actuator config options since the configuration setup is not using proper actuator configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions