Repository navigation
Missing Request Body for Write Operation Actuator Endpoints #1565
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
After adding springdoc.show-actuator=true, I can see all the actuator endpoints 👍 but I cannot see the Request Body field for the @WriteOperation endpoints (for example https://github.com/spring-projects/spring-boot/blob/47516b50c39bd6ea924a1f6720ce6d4a71088651/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/logging/LoggersEndpoint.java#L99).
In the following class it seems that only parameters are managed :
Line 23 in f39b640
| public class ActuatorOpenApiCustomizer implements OpenApiCustomiser { |
To Reproduce
Steps to reproduce the behavior:
- What version of spring-boot you are using? Tried with 2.5.10 and 2.6.4
- What modules and versions of springdoc-openapi are you using? Tried with 1.6.2 and 1.6.6
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-webmvc-core</artifactId>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
</dependency>- What is the actual and the expected result using OpenAPI Description (yml or json)?
"post": {
"tags": ["Actuator"],
"summary": "Actuator web endpoint 'loggers-name'",
"operationId": "loggers-name_7",
"parameters": [{
"name": "name",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {...},
}Expected behavior
- A clear and concise description of what you expected to happen.
We expect to have the Request Body field in case of@WriteOperationif it is possible as there is not@RequestBodyannotation. - What is the expected result using OpenAPI Description (yml or json)?
Something like this for the LoggersEndpoint :
"post": {
"tags": ["Actuator"],
"summary": "Actuator web endpoint 'loggers-name'",
"operationId": "loggers-name_7",
"parameters": [{
"name": "name",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"configuredLevel": {
"type": "string",
"required": true
}
}
}
}
},
"required": true
},
"responses": {...},
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
bnasslahsen commentedon Mar 21, 2022
@mathieu-amblard,
I have added a fix, to handle this case out of the box.
Feel free to test with the latest SNAPSHOT and provide your feedback.
Changes report: Missing Request Body for Write Operation Actuator End…
mathieu-amblard commentedon Mar 23, 2022
I works well, thank you for the fix and for your reactivity 👍
Missing Request Body for Write Operation Actuator Endpoints. Fixes #1565
Changes report: Missing Request Body for Write Operation Actuator End…
ajs139 commentedon Oct 22, 2025
The fix generates:
However, the request body should be an object type with a
configuredLevelproperty.jorgerod commentedon Nov 26, 2025
Hi @bnasslahsen @ajs139
I'm experiencing the same issue described here, even though the issue was marked as closed.
Context
I'm using a custom actuator endpoint from the Resilience4j library (version 2.3.0), specifically the
CircuitBreakerEndpointclass. This is a third-party library endpoint that we cannot modify - it comes from theio.github.resilience4j:resilience4j-spring-boot3dependency.The Problem
When using
@Endpointwith@WriteOperationannotations (Spring Boot Actuator's standard approach), the enum parameterUpdateStateis not rendered correctly in Swagger UI. The parameter appears but doesn't show the available enum values properly.Problematic code (from resilience4j library - we cannot modify this):
The
UpdateStateenum parameter doesn't display correctly in Swagger UI despite the@Parameterannotation with@Schemaconfiguration.Why @RestControllerEndpoint is NOT a solution for us
I've seen suggestions to use
@RestControllerEndpointinstead of@Endpoint, and I can confirm that approach works. However, this is not a viable solution in our case because:For reference, here's what a
@RestControllerEndpointimplementation looks like (which DOES work, but we cannot use it because we can't modify the library):Environment Details
Question
Is there a way to make
@Endpoint+@WriteOperationwork correctly with enum parameters in Swagger UI without having to wrap or recreate third-party library endpoints?The current situation forces us to either:
Neither option is ideal. Is there a configuration or workaround that would allow springdoc-openapi to properly introspect enum parameters in
@Endpoint+@WriteOperationmethods from third-party libraries?