
# 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

```properties
# lib/resources/application.properties
management.endpoints.web.exposure.include=health,mappings
```

```console
$ curl localhost:8080/actuator/mappings
```

```json
{"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 `MappingDescriptions` bean adds its key under `mappings`: the web starter's `dispatcherHandlers`, the navigation starter's `screens`.
- The context is named after `spring.application.name` (`application` by default); `parentId` is `null`.
- The `descriptor` of a method is its Dart signature, its `className` the 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](security.md)).

## 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.

## See also

- [Endpoints](endpoints.md)
- [Security](security.md)
- [spring_boot_starter_web](../spring-boot-starter-web/index.md)
