The /beans endpoint is a Spring Boot Actuator endpoint for exploring an application’s Spring application contexts. A GET request returns a JSON document describing every bean, including its Java type and injected dependencies. section 15.2.2
Read the response by following its context and bean structure:
- The contexts element contains one entry for each Spring application context. section 15.2.2
- Each context contains a beans element with details for all its beans. section 15.2.2
- Each bean entry can show aliases, scope, Java type, class-file resource, and injected dependencies. section 15.2.2
Inspecting a controller bean
A bean named ingredientsController can appear with singleton scope, type tacos.ingredients.IngredientsController, and ingredientRepository listed as an injected dependency. This turns the application context’s wiring into inspectable JSON. section 15.2.2
{
"contexts": {
"application-1": {
"beans": {
...
"ingredientsController": {
"aliases": [],
"scope": "singleton",
"type": "tacos.ingredients.IngredientsController",
"resource": "file [/Users/habuma/Documents/Workspaces/
TacoCloud/ingredient-service/target/classes/tacos/
ingredients/IngredientsController.class]",
"dependencies": [
"ingredientRepository"
]
},
...
},
"parentId": null
}
}
}
Browse a representative /beans response to see context, bean metadata, resource, and dependency fields together. section 15.2.2
