Skip to content

Commit 7131af5

Browse files
christophstroblmp911de
authored andcommitted
Document SpringDataJacksonModules in web support section.
Closes #2288 Original pull request: #2289.
1 parent 160fe4c commit 7131af5

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/main/asciidoc/repositories.adoc

+24
Original file line numberDiff line numberDiff line change
@@ -1214,6 +1214,7 @@ The configuration shown in the <<core.web,previous section>> registers a few bas
12141214

12151215
- A <<core.web.basic.domain-class-converter>> to let Spring MVC resolve instances of repository-managed domain classes from request parameters or path variables.
12161216
- <<core.web.basic.paging-and-sorting,`HandlerMethodArgumentResolver`>> implementations to let Spring MVC resolve `Pageable` and `Sort` instances from request parameters.
1217+
- <<core.web.basic.jackson-mappers, Jackson Modules>> to de-/serialize types like `Point` and `Distance`, or store specific ones, depending on the Spring Data Module used.
12171218

12181219
[[core.web.basic.domain-class-converter]]
12191220
===== Using the `DomainClassConverter` Class
@@ -1363,6 +1364,29 @@ Assume we have 30 `Person` instances in the database. You can now trigger a requ
13631364

13641365
The assembler produced the correct URI and also picked up the default configuration to resolve the parameters into a `Pageable` for an upcoming request. This means that, if you change that configuration, the links automatically adhere to the change. By default, the assembler points to the controller method it was invoked in, but you can customize that by passing a custom `Link` to be used as base to build the pagination links, which overloads the `PagedResourcesAssembler.toResource(…)` method.
13651366

1367+
[[core.web.basic.jackson-mappers]]
1368+
==== Spring Data Jackson Modules
1369+
1370+
The core module, and some of the store specific ones, ship with a set of Jackson Modules for types, like `org.springframework.data.geo.Distance` and `org.springframework.data.geo.Point`, used by the Spring Data domain. +
1371+
Those Modules are imported once <<core.web, web support>> is enabled and `com.fasterxml.jackson.databind.ObjectMapper` is available.
1372+
1373+
During initialization `SpringDataJacksonModules`, like the `SpringDataJacksonConfiguration`, get picked up by the infrastructure, so that the declared ``com.fasterxml.jackson.databind.Module``s are made available to the Jackson `ObjectMapper`.
1374+
1375+
Data binding mixins for the following domain types are registered by the common infrastructure.
1376+
----
1377+
org.springframework.data.geo.Distance
1378+
org.springframework.data.geo.Point
1379+
org.springframework.data.geo.Box
1380+
org.springframework.data.geo.Circle
1381+
org.springframework.data.geo.Polygon
1382+
----
1383+
1384+
[NOTE]
1385+
====
1386+
The individual module may provide additional `SpringDataJacksonModules`. +
1387+
Please refer to the store specific section for more details.
1388+
====
1389+
13661390
[[core.web.binding]]
13671391
==== Web Databinding Support
13681392

0 commit comments

Comments
 (0)