Spring Boot Actuator 2.x Mappings
See original GitHub issueKeeping in mind that Spring Boot 2.x isn’t officially supported yet, the new Endpoint
discovery Spring is using for the Actuator is causing the RequestHandlers
to produce inaccurate parameter lists. It appears to be not detecting path parameters and also producing an additional optional body
parameter (though the UI does not treat it as optional).
Given a few months, will this work differently or is there something I should add to my config to have these discovered properly?
Using Spring Boot 2.0.1 and SpringFox Swagger 2.9.0
@Bean
public Docket actuator() {
return new Docket(DocumentationType.SWAGGER_2)
.groupName("Spring Boot Actuator")
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.regex("/actuator.*"))
.build();
}
// http://localhost:8095/v2/api-docs?group=Spring%20Boot%20Actuator
{
...
"paths": {
...
"/actuator/env/{toMatch}": {
"get": {
"tags": [
"operation-handler"
],
"summary": "handle",
"operationId": "handleUsingGET_6",
"produces": [
"application/json",
"application/vnd.spring-boot.actuator.v2+json"
],
"parameters": [
{
"in": "body",
"name": "body",
"description": "body",
"required": false,
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object"
}
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
},
"404": {
"description": "Not Found"
}
}
}
},
"/actuator/health": {
"get": {
"tags": [
"operation-handler"
],
"summary": "handle",
"operationId": "handleUsingGET_8",
"produces": [
"application/json",
"application/vnd.spring-boot.actuator.v2+json"
],
"parameters": [
{
"in": "body",
"name": "body",
"description": "body",
"required": false,
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object"
}
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
},
"404": {
"description": "Not Found"
}
}
}
},
...
}
}
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:18 (2 by maintainers)
Top Results From Across the Web
Spring Boot Actuator Web API Documentation
mappings are described in the following sections. 17.1.2. Dispatcher Servlets Response Structure. When using Spring MVC, the response contains details of any ...
Read more >Spring Boot Actuator | Baeldung
A quick intro to Spring Boot Actuators - using and extending the existing ones, configuration and rolling your own.
Read more >Spring Boot 2 health actuator default mapping - Stack Overflow
If you want change /application/health to /health, then you should use endpoints.jmx.domain . Or change path of your application to ROOT. See.
Read more >Spring Boot Actuator Endpoints - DigitalOcean
Spring Boot Actuator Endpoints lets us monitor and interact with our application. Spring Actuator is a Spring Boot sub-module and provides ...
Read more >Actuator with Spring Boot 2.x | New features | JavaTechie
This tutorial will guide you what is actuator and its enhancement in spring boot 2. x version also you will learn how to...
Read more >
Top Related Medium Post
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
There is a dirty workaround here. We can use it till either springfox/springboot team fixes it.
springboot 2.3 + actuator and swagger 2.9.2 still get this error