Skip to content

Commit c537643

Browse files
christophstroblmp911de
authored andcommitted
Document SpringDataJacksonModules in web support section.
Closes spring-projects#2288 Original pull request: spring-projects#2289.
1 parent f83a2ed commit c537643

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
@@ -1377,6 +1377,7 @@ The configuration shown in the <<core.web,previous section>> registers a few bas
13771377

13781378
- A <<core.web.basic.domain-class-converter>> to let Spring MVC resolve instances of repository-managed domain classes from request parameters or path variables.
13791379
- <<core.web.basic.paging-and-sorting,`HandlerMethodArgumentResolver`>> implementations to let Spring MVC resolve `Pageable` and `Sort` instances from request parameters.
1380+
- <<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.
13801381

13811382
[[core.web.basic.domain-class-converter]]
13821383
===== Using the `DomainClassConverter` Class
@@ -1539,6 +1540,29 @@ The assembler produced the correct URI and also picked up the default configurat
15391540
This means that, if you change that configuration, the links automatically adhere to the change.
15401541
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.
15411542

1543+
[[core.web.basic.jackson-mappers]]
1544+
==== Spring Data Jackson Modules
1545+
1546+
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. +
1547+
Those Modules are imported once <<core.web, web support>> is enabled and `com.fasterxml.jackson.databind.ObjectMapper` is available.
1548+
1549+
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`.
1550+
1551+
Data binding mixins for the following domain types are registered by the common infrastructure.
1552+
----
1553+
org.springframework.data.geo.Distance
1554+
org.springframework.data.geo.Point
1555+
org.springframework.data.geo.Box
1556+
org.springframework.data.geo.Circle
1557+
org.springframework.data.geo.Polygon
1558+
----
1559+
1560+
[NOTE]
1561+
====
1562+
The individual module may provide additional `SpringDataJacksonModules`. +
1563+
Please refer to the store specific section for more details.
1564+
====
1565+
15421566
[[core.web.binding]]
15431567
==== Web Databinding Support
15441568

0 commit comments

Comments
 (0)