Skip to content

Actuator endpoints have 2 appended to operationId #1421

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ddulaney opened this issue Jan 4, 2022 · 1 comment
Closed

Actuator endpoints have 2 appended to operationId #1421

ddulaney opened this issue Jan 4, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@ddulaney
Copy link

ddulaney commented Jan 4, 2022

Describe the bug

When using Spring Boot Actuator, Springdoc includes the endpoints in the spec (🎉), but the operationIds are a little odd:

  /meta/health:
    get:
      tags:
        - Actuator
      summary: Actuator web endpoint 'health'
      operationId: health_2

  /meta/info:
    get:
      tags:
        - Actuator
      summary: Actuator web endpoint 'info'
      operationId: info_2

To Reproduce
Here's the relevant portion of my application.yml:

# OpenAPI
springdoc:
  # Include actuator endpoints
  show-actuator: true
  # Redirect from root to Swagger UI
  swagger-ui.use-root-path: true
  version: ${BUILD_VERSION:unset}
  default-produces-media-type: application/json
  # Exclude the k8s probes because they don't generate properly and shouldn't be used by clients anyway
  paths-to-exclude: "/meta/health/*"

# Expose some actuator endpoints over REST
management:
  endpoint:
    # Enable info & health
    info.enabled: true
    health.enabled: true
  endpoints:
    # Disable other endpoints
    enabled-by-default: false
    # Don't expose anything over JMX
    jmx.exposure.exclude: "*"
    web:
      exposure.include: "*"
      # Disable the actuator root discovery endpoint
      discovery.enabled: false
      # Customize path mappings
      base-path: /meta

Expected behavior
I would expect the operationIds to be health and info.

Additional context
Somewhat related to #1264

@bnasslahsen bnasslahsen added the enhancement New feature or request label Jan 9, 2022
@jarek-jpa
Copy link

hi, I am still getting this issue with openapi-2.3.0 and Spring Boot 3.2.2. looking at the code (ActuatorOperationCustomizer), the fix with altering operationId after extracting it from handlerMethod does not work, since the handler is AbstractWebMvcEndpointHandlerMapping and it does not get matched against provided regex. shall I open a new issue?

mpleine pushed a commit to mpleine/springdoc-openapi that referenced this issue May 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants