From 4f3ec26ee1bf87e7e117ac56d17a72ad0243288c Mon Sep 17 00:00:00 2001 From: Christoph Strobl Date: Tue, 2 Feb 2021 08:40:49 +0100 Subject: [PATCH 1/2] Prepare issue branch. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9be85dfb76..7278adb1e3 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.data spring-data-commons - 2.5.0-SNAPSHOT + 2.5.0-GH-2288-SNAPSHOT Spring Data Core From 40222885d9383096957f8587e8994255ba034774 Mon Sep 17 00:00:00 2001 From: Christoph Strobl Date: Tue, 2 Feb 2021 10:12:16 +0100 Subject: [PATCH 2/2] Document SpringDataJacksonModules in web support section. Closes #2288 --- src/main/asciidoc/repositories.adoc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/main/asciidoc/repositories.adoc b/src/main/asciidoc/repositories.adoc index 340e1ea8ba..0e2ae66dd5 100644 --- a/src/main/asciidoc/repositories.adoc +++ b/src/main/asciidoc/repositories.adoc @@ -1362,6 +1362,7 @@ The configuration shown in the <> registers a few bas - A <> to let Spring MVC resolve instances of repository-managed domain classes from request parameters or path variables. - <> implementations to let Spring MVC resolve `Pageable` and `Sort` instances from request parameters. +- <> to de-/serialize types like `Point` and `Distance`, or store specific ones, depending on the Spring Data Module used. [[core.web.basic.domain-class-converter]] ===== Using the `DomainClassConverter` Class @@ -1524,6 +1525,29 @@ The assembler produced the correct URI and also picked up the default configurat 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. +[[core.web.basic.jackson-mappers]] +==== Spring Data Jackson Modules + +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. + +Those Modules are imported once <> is enabled and `com.fasterxml.jackson.databind.ObjectMapper` is available. + +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`. + +Data binding mixins for the following domain types are registered by the common infrastructure. +---- +org.springframework.data.geo.Distance +org.springframework.data.geo.Point +org.springframework.data.geo.Box +org.springframework.data.geo.Circle +org.springframework.data.geo.Polygon +---- + +[NOTE] +==== +The individual module may provide additional `SpringDataJacksonModules`. + +Please refer to the store specific section for more details. +==== + [[core.web.binding]] ==== Web Databinding Support