Mappings
/actuator/mappings lists every address the application answers: each controller method with its path, methods and media types, the static resources, and in an app with the navigation starter its screens. It is Spring Boot's mappings endpoint.
Why
"Which endpoint answers /api/books/123?" is a common question when debugging routing, a proxy or a security rule. The mappings endpoint answers it from the running application, as the dispatcher sees it.
Example
# lib/resources/application.properties
management.endpoints.web.exposure.include=health,mappings
$ curl localhost:8080/actuator/mappings
{"contexts": {"shop": {"mappings": {
"dispatcherHandlers": {"webHandler": [
{"predicate": "{GET [/api/books/{isbn}], produces [application/json]}",
"handler": "BookController#find(String)",
"details": {"handlerMethod": {"className": "BookController", "name": "find",
"descriptor": "(String isbn) -> Future<Book>"},
"requestMappingConditions": {"consumes": [], "headers": [], "methods": ["GET"],
"params": [], "patterns": ["/api/books/{isbn}"],
"produces": [{"mediaType": "application/json", "negated": false}]}}},
{"predicate": "/**", "handler": "ResourceWebHandler [resources:static/, resources:public/]"}]}},
"parentId": null}}}
What is listed
- Every
MappingDescriptionsbean adds its key undermappings: the web starter'sdispatcherHandlers, the navigation starter'sscreens. - The context is named after
spring.application.name(applicationby default);parentIdisnull. - The
descriptorof a method is its Dart signature, itsclassNamethe Dart class name.
The endpoint is enabled by default but not exposed: add mappings to management.endpoints.web.exposure.include. Since it shows every address, protect it (see Security).
In Spring (Java)
The same endpoint, in Spring WebFlux's shape (dispatcherHandlers, never dispatcherServlets, since the web starter is not a servlet container). screens is this project's own.