From 251c922960dd9b6173b03e449b77e8cecb566e0d Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Fri, 25 Sep 2026 00:29:21 +0000
Subject: [PATCH] chore(catalog): record data-rest-5.0.0
---
catalog.json | 8 +-
markdown/data-rest/5.0.0/LICENSE | 201 +++++++
markdown/data-rest/5.0.0/NOTICE | 74 +++
markdown/data-rest/5.0.0/_index.md | 28 +
markdown/data-rest/5.0.0/customizing-sdr.md | 114 ++++
.../adding-sdr-to-spring-mvc-app.md | 53 ++
.../5.0.0/customizing/configuring-cors.md | 83 +++
.../configuring-the-rest-url-path.md | 210 +++++++
.../custom-jackson-deserialization.md | 79 +++
.../customizing/customizing-json-output.md | 51 ++
.../overriding-sdr-response-handlers.md | 110 ++++
.../5.0.0/etags-and-other-conditionals.md | 114 ++++
markdown/data-rest/5.0.0/events.md | 88 +++
markdown/data-rest/5.0.0/index.md | 66 +++
markdown/data-rest/5.0.0/integration.md | 49 ++
markdown/data-rest/5.0.0/intro.md | 12 +
.../example-api-usage-with-curl.md | 15 +
.../5.0.0/introduction/getting-started.md | 203 +++++++
.../introduction/spring-data-rest-examples.md | 37 ++
.../data-rest/5.0.0/introduction/upgrade.md | 13 +
markdown/data-rest/5.0.0/metadata.md | 401 +++++++++++++
.../data-rest/5.0.0/paging-and-sorting.md | 138 +++++
.../data-rest/5.0.0/projections-excerpts.md | 332 +++++++++++
.../data-rest/5.0.0/repository-resources.md | 534 ++++++++++++++++++
markdown/data-rest/5.0.0/representations.md | 80 +++
markdown/data-rest/5.0.0/security.md | 108 ++++
markdown/data-rest/5.0.0/tools.md | 58 ++
markdown/data-rest/5.0.0/validation.md | 25 +
28 files changed, 3283 insertions(+), 1 deletion(-)
create mode 100644 markdown/data-rest/5.0.0/LICENSE
create mode 100644 markdown/data-rest/5.0.0/NOTICE
create mode 100644 markdown/data-rest/5.0.0/_index.md
create mode 100644 markdown/data-rest/5.0.0/customizing-sdr.md
create mode 100644 markdown/data-rest/5.0.0/customizing/adding-sdr-to-spring-mvc-app.md
create mode 100644 markdown/data-rest/5.0.0/customizing/configuring-cors.md
create mode 100644 markdown/data-rest/5.0.0/customizing/configuring-the-rest-url-path.md
create mode 100644 markdown/data-rest/5.0.0/customizing/custom-jackson-deserialization.md
create mode 100644 markdown/data-rest/5.0.0/customizing/customizing-json-output.md
create mode 100644 markdown/data-rest/5.0.0/customizing/overriding-sdr-response-handlers.md
create mode 100644 markdown/data-rest/5.0.0/etags-and-other-conditionals.md
create mode 100644 markdown/data-rest/5.0.0/events.md
create mode 100644 markdown/data-rest/5.0.0/index.md
create mode 100644 markdown/data-rest/5.0.0/integration.md
create mode 100644 markdown/data-rest/5.0.0/intro.md
create mode 100644 markdown/data-rest/5.0.0/introduction/example-api-usage-with-curl.md
create mode 100644 markdown/data-rest/5.0.0/introduction/getting-started.md
create mode 100644 markdown/data-rest/5.0.0/introduction/spring-data-rest-examples.md
create mode 100644 markdown/data-rest/5.0.0/introduction/upgrade.md
create mode 100644 markdown/data-rest/5.0.0/metadata.md
create mode 100644 markdown/data-rest/5.0.0/paging-and-sorting.md
create mode 100644 markdown/data-rest/5.0.0/projections-excerpts.md
create mode 100644 markdown/data-rest/5.0.0/repository-resources.md
create mode 100644 markdown/data-rest/5.0.0/representations.md
create mode 100644 markdown/data-rest/5.0.0/security.md
create mode 100644 markdown/data-rest/5.0.0/tools.md
create mode 100644 markdown/data-rest/5.0.0/validation.md
diff --git a/catalog.json b/catalog.json
index 30ddc5d5a..87d54bd2b 100644
--- a/catalog.json
+++ b/catalog.json
@@ -1,7 +1,7 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"version": "1",
- "generated_at": "2026-09-24T16:19:40.972Z",
+ "generated_at": "2026-09-25T00:29:21.466Z",
"projects": {
"ai": {
"1.0.0": {
@@ -1883,6 +1883,12 @@
"released_at": "2026-09-24T15:53:06Z"
}
},
+ "data-rest": {
+ "5.0.0": {
+ "tag": "data-rest-5.0.0",
+ "released_at": "2026-09-25T00:29:20Z"
+ }
+ },
"framework": {
"6.1.0": {
"tag": "framework-6.1.0",
diff --git a/markdown/data-rest/5.0.0/LICENSE b/markdown/data-rest/5.0.0/LICENSE
new file mode 100644
index 000000000..c2f816780
--- /dev/null
+++ b/markdown/data-rest/5.0.0/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for describing the origin of the Work and
+ reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Support. While redistributing the Work or
+ Derivative Works thereof, You may choose to offer, and charge a
+ fee for, acceptance of support, warranty, indemnity, or other
+ liability obligations and/or rights consistent with this License.
+ However, in accepting such obligations, You may act only on Your
+ own behalf and on Your sole responsibility, not on behalf of any
+ other Contributor, and only if You agree to indemnify, defend,
+ and hold each Contributor harmless for any liability incurred by,
+ or claims asserted against, such Contributor by reason of your
+ accepting any such warranty or support.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright 2026 Passion Factory
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ permissions and limitations under the License.
diff --git a/markdown/data-rest/5.0.0/NOTICE b/markdown/data-rest/5.0.0/NOTICE
new file mode 100644
index 000000000..84a46b5e1
--- /dev/null
+++ b/markdown/data-rest/5.0.0/NOTICE
@@ -0,0 +1,74 @@
+data-rest 5.0.0 — converted Spring documentation
+
+This archive contains documentation converted from:
+ Repository: https://github.com/spring-projects/spring-data-rest
+ Ref: 5.0.0
+ Commit: 0ae642131f36b87b9a46c568e53a7b56f99c72ff
+
+The documentation is licensed under the Apache License, Version 2.0, by its
+original authors. Conversion changed formatting only; the meaning of the
+content is unmodified. The upstream license and attribution follow.
+
+---
+
+@pleaseai/spring-docs
+Copyright 2026 Passion Factory
+
+This product includes software developed by Passion Factory (https://passionfactory.ai).
+
+================================================================================
+Redistributed Documentation Content
+================================================================================
+
+This repository redistributes documentation generated from the following
+upstream projects. All redistributed content retains its original copyright
+and is licensed under the Apache License, Version 2.0.
+
+The Markdown files in this repository (and in the GitHub Release archives it
+publishes) are mechanical conversions from the original sources. Content
+meaning is unchanged; only the file format differs.
+
+--------------------------------------------------------------------------------
+Spring Framework
+ Copyright (c) 2002-present, the Spring Framework authors.
+ Source: https://github.com/spring-projects/spring-framework
+ License: Apache License, Version 2.0
+ Notice: https://github.com/spring-projects/spring-framework/blob/main/NOTICE.txt
+
+Spring Boot
+ Copyright (c) 2012-present, the Spring Boot authors.
+ Source: https://github.com/spring-projects/spring-boot
+ License: Apache License, Version 2.0
+ Notice: https://github.com/spring-projects/spring-boot/blob/main/NOTICE.txt
+
+Spring Security
+ Copyright (c) 2002-present, the Spring Security authors.
+ Source: https://github.com/spring-projects/spring-security
+ License: Apache License, Version 2.0
+ Notice: https://github.com/spring-projects/spring-security/blob/main/NOTICE.txt
+
+Spring AI
+ Copyright (c) 2023-present, the Spring AI authors.
+ Source: https://github.com/spring-projects/spring-ai
+ License: Apache License, Version 2.0
+
+Spring Data (and its sub-projects: JPA, JDBC, MongoDB, Redis, etc.)
+ Copyright (c) 2008-present, the Spring Data authors.
+ Source: https://github.com/spring-projects/spring-data-*
+ License: Apache License, Version 2.0
+
+Spring Cloud (and its sub-projects)
+ Copyright (c) 2013-present, the Spring Cloud authors.
+ Source: https://github.com/spring-cloud/*
+ License: Apache License, Version 2.0
+--------------------------------------------------------------------------------
+
+Per-release attribution:
+ Each GitHub Release archive published from this repository includes a
+ NOTICE file pinned to the exact upstream commit/tag from which the
+ documentation was generated. Consult the archive's NOTICE for the
+ authoritative attribution applicable to that release.
+
+If you are a maintainer of any upstream project listed above and have
+concerns about how this documentation is redistributed, please open an
+issue at https://github.com/pleaseai/spring-docs/issues.
diff --git a/markdown/data-rest/5.0.0/_index.md b/markdown/data-rest/5.0.0/_index.md
new file mode 100644
index 000000000..3b7525561
--- /dev/null
+++ b/markdown/data-rest/5.0.0/_index.md
@@ -0,0 +1,28 @@
+# data-rest 5.0.0
+
+24 pages, converted from upstream Spring AsciiDoc.
+
+- [customizing-sdr](./customizing-sdr.md)
+- [customizing/adding-sdr-to-spring-mvc-app](./customizing/adding-sdr-to-spring-mvc-app.md)
+- [customizing/configuring-cors](./customizing/configuring-cors.md)
+- [customizing/configuring-the-rest-url-path](./customizing/configuring-the-rest-url-path.md)
+- [customizing/custom-jackson-deserialization](./customizing/custom-jackson-deserialization.md)
+- [customizing/customizing-json-output](./customizing/customizing-json-output.md)
+- [customizing/overriding-sdr-response-handlers](./customizing/overriding-sdr-response-handlers.md)
+- [etags-and-other-conditionals](./etags-and-other-conditionals.md)
+- [events](./events.md)
+- [index](./index.md)
+- [integration](./integration.md)
+- [intro](./intro.md)
+- [introduction/example-api-usage-with-curl](./introduction/example-api-usage-with-curl.md)
+- [introduction/getting-started](./introduction/getting-started.md)
+- [introduction/spring-data-rest-examples](./introduction/spring-data-rest-examples.md)
+- [introduction/upgrade](./introduction/upgrade.md)
+- [metadata](./metadata.md)
+- [paging-and-sorting](./paging-and-sorting.md)
+- [projections-excerpts](./projections-excerpts.md)
+- [repository-resources](./repository-resources.md)
+- [representations](./representations.md)
+- [security](./security.md)
+- [tools](./tools.md)
+- [validation](./validation.md)
diff --git a/markdown/data-rest/5.0.0/customizing-sdr.md b/markdown/data-rest/5.0.0/customizing-sdr.md
new file mode 100644
index 000000000..934508708
--- /dev/null
+++ b/markdown/data-rest/5.0.0/customizing-sdr.md
@@ -0,0 +1,114 @@
+---
+title: "Customizing Spring Data REST"
+source: "ROOT:customizing-sdr.adoc"
+---
+
+
+
+# Customizing Spring Data REST
+
+There are many options to tailor Spring Data REST. These subsections show how.
+
+
+
+## Customizing Item Resource URIs
+
+By default, the URI for item resources are comprised of the path segment used for the collection resource with the database identifier appended.
+That lets you use the repository’s `findOne(…)` method to lookup entity instances.
+As of Spring Data REST 2.5, this can be customized by using configuration API on `RepositoryRestConfiguration` (preferred on Java 8) or by registering an implementation of `EntityLookup` as a Spring bean in your application.
+Spring Data REST picks those up and tweaks the URI generation according to their implementation.
+
+Assume a `User` with a `username` property that uniquely identifies it.
+Further assume that we have a `Optional findByUsername(String username)` method on the corresponding repository.
+
+On Java 8, we can register the mapping methods as method references to tweak the URI creation, as follows:
+
+```java
+@Component
+public class SpringDataRestCustomization implements RepositoryRestConfigurer {
+
+ @Override
+ public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
+ config.withEntityLookup()
+ .forRepository(UserRepository.class)
+ .withIdMapping(User::getUsername)
+ .withLookup(UserRepository::findByUsername);
+ }
+}
+```
+
+`forRepository(…)` takes the repository type as the first argument, a method reference mapping the repositories domain type to some target type as the second argument, and another method reference to map that value back by using the repository mentioned as the first argument.
+
+If you are not running Java 8 or better, you could use the method, but it would require a few quite verbose anonymous inner classes.
+On older Java versions, you should probably prefer implementing a `UserEntityLookup` that resembles the following:
+
+```java
+@Component
+public class UserEntityLookup extends EntityLookupSupport {
+
+ private final UserRepository repository;
+
+ public UserEntityLookup(UserRepository repository) {
+ this.repository = repository;
+ }
+
+ @Override
+ public Serializable getResourceIdentifier(User entity) {
+ return entity.getUsername();
+ }
+
+ @Override
+ public Object lookupEntity(Serializable id) {
+ return repository.findByUsername(id.toString());
+ }
+}
+```
+
+Notice how `getResourceIdentifier(…)` returns the username to be used by the URI creation. To load entity instances by the value returned from that method, we now implement `lookupEntity(…)` by using the query method available on the `UserRepository`.
+
+
+
+## Customizing repository exposure
+
+By default, all public Spring Data repositories are used to expose HTTP resources as described in [Repository resources](repository-resources.md).
+Package protected repository interfaces are excluded from this list, as you express its functionality is only visible to the package internally.
+This can be customized by explicitly setting a `RepositoryDetectionStrategy` (usually through the enum `RepositoryDetectionStrategies`) on `RepositoryRestConfiguration`.
+The following values can be configured:
+
+- `ALL` — exposes all Spring Data repositories regardless of their Java visibility or annotation configuration.
+- `DEFAULT` — exposes public Spring Data repositories or ones explicitly annotated with `@RepositoryRestResource` and its `exported` attribute not set to `false`.
+- `VISIBILITY` — exposes only public Spring Data repositories regardless of annotation configuration.
+- `ANNOTATED` — only exposes Spring Data repositories explicitly annotated with `@RepositoryRestResource` and its `exported` attribute not set to `false`.
+
+If you need custom rules to apply, simply implement `RepositoryDetectionStrategy` manually.
+
+
+
+## Customizing supported HTTP methods
+
+
+
+### Customizing default exposure
+
+By default, Spring Data REST exposes HTTP resources and methods as described in [Repository resources](repository-resources.md) based on which CRUD methods the repository exposes.
+The repositories don’t need to extend `CrudRepository` but can also selectively declare methods described in aforementioned section and the resource exposure will follow.
+E.g. if a repository does not expose a `delete(…)` method, an HTTP `DELETE` will not be supported for item resources.
+
+If you need to declare a method for internal use but don’t want it to trigger the HTTP method exposure, the repository method can be annotated with `@RestResource(exported = false)`.
+Which methods to annotate like that to remove support for which HTTP method is described in [Repository resources](repository-resources.md).
+
+Sometimes managing the exposure on the method level is not fine-grained enough.
+E.g. the `save(…)` method is used to back `POST` on collection resources, as well as `PUT` and `PATCH` on item resources.
+To selectively define which HTTP methods are supposed to be exposed, you can use `RepositoryRestConfiguration.getExposureConfiguration()`.
+
+The class exposes a Lambda based API to define both global and type-based rules:
+
+```java
+ExposureConfiguration config = repositoryRestConfiguration.getExposureConfiguration();
+
+config.forDomainType(User.class).disablePutForCreation(); <1>
+config.withItemExposure((metadata, httpMethods) -> httpMethods.disable(HttpMethod.PATCH)); <2>
+```
+
+1. Disables the support for HTTP `PUT` to create item resources directly.
+1. Disables the support for HTTP `PATCH` on all item resources.
diff --git a/markdown/data-rest/5.0.0/customizing/adding-sdr-to-spring-mvc-app.md b/markdown/data-rest/5.0.0/customizing/adding-sdr-to-spring-mvc-app.md
new file mode 100644
index 000000000..d3d7bde0b
--- /dev/null
+++ b/markdown/data-rest/5.0.0/customizing/adding-sdr-to-spring-mvc-app.md
@@ -0,0 +1,53 @@
+---
+title: "Adding Spring Data REST to an Existing Spring MVC Application"
+source: "ROOT:customizing/adding-sdr-to-spring-mvc-app.adoc"
+---
+
+
+
+# Adding Spring Data REST to an Existing Spring MVC Application
+
+> [!NOTE]
+> The following steps are unnecessary if you use Spring Boot. For Boot applications, adding `spring-boot-starter-data-rest` automatically adds Spring Data REST to your application.
+
+You can integrate Spring Data REST with an existing Spring MVC application. In your Spring MVC configuration (most likely where you configure your MVC resources), add a bean reference to the Java configuration class that is responsible for configuring the `RepositoryRestController`. The class name is `org.springframework.data.rest.webmvc.RepositoryRestMvcConfiguration`. The following example shows how to use an `@Import` annotation to add the proper reference:
+
+The configuration would look like:
+
+#### Java
+
+```java
+import org.springframework.context.annotation.Import;
+import org.springframework.data.rest.webmvc.RepositoryRestMvcConfiguration;
+
+@Configuration
+@Import(RepositoryRestMvcConfiguration.class)
+public class MyApplicationConfiguration {
+
+ …
+}
+```
+
+#### XML
+
+```xml
+
+```
+
+When your ApplicationContext comes across this bean definition, it bootstraps the necessary Spring MVC resources to fully configure the controller for exporting the repositories it finds in that `ApplicationContext` and any parent contexts.
+
+
+
+## More on Required Configuration
+
+Spring Data REST depends on a couple Spring MVC resources that must be configured correctly for it to work inside an existing Spring MVC application. We tried to isolate those resources from whatever similar resources already exist within your application, but it may be that you want to customize some of the behavior of Spring Data REST by modifying these MVC components.
+
+You should pay special attention to configuring `RepositoryRestHandlerMapping`, covered in the next section.
+
+
+
+### `RepositoryRestHandlerMapping`
+
+We register a custom `HandlerMapping` instance that responds only to the `RepositoryRestController` and only if a path is meant to be handled by Spring Data REST. In order to keep paths that are meant to be handled by your application separate from those handled by Spring Data REST, this custom `HandlerMapping` class inspects the URL path and checks to see if a repository has been exported under that name. If it has, the custom `HandlerMapping` class lets the request be handled by Spring Data REST. If there is no Repository exported under that name, it returns `null`, which means “let other `HandlerMapping` instances try to service this request”.
+
+The Spring Data REST `HandlerMapping` is configured with `order=(Ordered.LOWEST_PRECEDENCE - 100)`, which means it is usually first in line when it comes time to map a URL path. Your existing application never gets a chance to service a request that is meant for a repository. For example, if you have a repository exported under the name of `person`, then all requests to your application that start with `/person` are handled by Spring Data REST, and your application never sees that request. If your repository is exported under a different name (such as `people`), however, then requests to `/people` go to Spring Data REST and requests to `/person` are handled by your application.
diff --git a/markdown/data-rest/5.0.0/customizing/configuring-cors.md b/markdown/data-rest/5.0.0/customizing/configuring-cors.md
new file mode 100644
index 000000000..b37e932b2
--- /dev/null
+++ b/markdown/data-rest/5.0.0/customizing/configuring-cors.md
@@ -0,0 +1,83 @@
+---
+title: "Configuring CORS"
+source: "ROOT:customizing/configuring-cors.adoc"
+---
+
+
+
+# Configuring CORS
+
+For security reasons, browsers prohibit AJAX calls to resources residing outside the current origin. When working with client-side HTTP requests issued by a browser, you want to enable specific HTTP resources to be accessible.
+
+Spring Data REST, as of 2.6, supports [Cross-Origin Resource Sharing](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) (CORS) through [Spring’s CORS](https://docs.spring.io/spring-framework/reference/7.0/web.html#mvc-cors) support.
+
+
+
+## Repository Interface CORS Configuration
+
+You can add a `@CrossOrigin` annotation to your repository interfaces to enable CORS for the whole repository. By default, `@CrossOrigin` allows all origins and HTTP methods. The following example shows a cross-origin repository interface definition:
+
+```java
+@CrossOrigin
+interface PersonRepository extends CrudRepository {}
+```
+
+In the preceding example, CORS support is enabled for the whole `PersonRepository`. `@CrossOrigin` provides attributes to configure CORS support, as the following example shows:
+
+```java
+@CrossOrigin(origins = "http://domain2.example",
+ methods = { RequestMethod.GET, RequestMethod.POST, RequestMethod.DELETE },
+ maxAge = 3600)
+interface PersonRepository extends CrudRepository {}
+```
+
+The preceding example enables CORS support for the whole `PersonRepository` by providing one origin, restricted to the `GET`, `POST`, and `DELETE` methods and with a max age of 3600 seconds.
+
+
+
+## Repository REST Controller Method CORS Configuration
+
+Spring Data REST fully supports [Spring Web MVC’s controller method configuration](https://docs.spring.io/spring-framework/reference/7.0/web.html#mvc-cors-controller) on custom REST controllers that share repository base paths, as the following example shows:
+
+```java
+@RepositoryRestController
+public class PersonController {
+
+ @CrossOrigin(maxAge = 3600)
+ @RequestMapping(path = "/people/xml/{id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_XML_VALUE)
+ public Person retrieve(@PathVariable Long id) {
+ // …
+ }
+}
+```
+
+> [!NOTE]
+> Controllers annotated with `@RepositoryRestController` inherit `@CrossOrigin` configuration from their associated repositories.
+
+
+
+## Global CORS Configuration
+
+In addition to fine-grained, annotation-based configuration, you probably want to define some global CORS configuration as well. This is similar to Spring Web MVC’S CORS configuration but can be declared within Spring Data REST and combined with fine-grained `@CrossOrigin` configuration. By default, all origins and `GET`, `HEAD`, and `POST` methods are allowed.
+
+> [!NOTE]
+> Existing Spring Web MVC CORS configuration is not applied to Spring Data REST.
+
+The following example sets an allowed origin, adds the PUT and DELETE HTTP methods, adds and exposes some headers, and sets a maximum age of an hour:
+
+```java
+@Component
+public class SpringDataRestCustomization implements RepositoryRestConfigurer {
+
+ @Override
+ public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config, CorsRegistry cors) {
+
+ cors.addMapping("/person/**")
+ .allowedOrigins("http://domain2.example")
+ .allowedMethods("PUT", "DELETE")
+ .allowedHeaders("header1", "header2", "header3")
+ .exposedHeaders("header1", "header2")
+ .allowCredentials(false).maxAge(3600);
+ }
+}
+```
diff --git a/markdown/data-rest/5.0.0/customizing/configuring-the-rest-url-path.md b/markdown/data-rest/5.0.0/customizing/configuring-the-rest-url-path.md
new file mode 100644
index 000000000..1b4b82d43
--- /dev/null
+++ b/markdown/data-rest/5.0.0/customizing/configuring-the-rest-url-path.md
@@ -0,0 +1,210 @@
+---
+title: "Configuring the REST URL Path"
+source: "ROOT:customizing/configuring-the-rest-url-path.adoc"
+---
+
+
+
+# Configuring the REST URL Path
+
+You can configure the segments of the URL path under which the resources of a JPA repository are exported. To do so, add an annotation at the class level or at the query method level.
+
+By default, the exporter exposes your `CrudRepository` by using the name of the domain class. Spring Data REST also applies the [Evo Inflector](https://github.com/atteo/evo-inflector) to pluralize this word. Consider the following repository definition:
+
+```java
+interface PersonRepository extends CrudRepository {}
+```
+
+The repository defined by the preceding example is exposed at `localhost:8080/persons/`.
+
+To change how the repository is exported, add a `@RestResource` annotation at the class level, as the following example shows:
+
+```java
+@RepositoryRestResource(path = "people")
+interface PersonRepository extends CrudRepository {}
+```
+
+The repository defined by the preceding example is accessible at `localhost:8080/people/`.
+
+If you have query methods defined, those also default to being exposed by their name, as the following example shows:
+
+```java
+interface PersonRepository extends CrudRepository {
+
+ List findByName(String name);
+}
+```
+
+The method in the preceding example is exposed at `localhost:8080/persons/search/findByName`.
+
+> [!NOTE]
+> All query method resources are exposed under the `search` resource.
+
+To change the segment of the URL under which this query method is exposed, you can use the `@RestResource` annotation again, as the following example shows:
+
+```java
+@RepositoryRestResource(path = "people")
+interface PersonRepository extends CrudRepository {
+
+ @RestResource(path = "names")
+ List findByName(String name);
+}
+```
+
+Now the query method in the preceding example is exposed at `localhost:8080/people/search/names`.
+
+
+
+## Handling `rel` Attributes
+
+Since these resources are all discoverable, you can also affect how the `rel` attribute is displayed in the links sent out by the exporter.
+
+For instance, in the default configuration, if you issue a request to `localhost:8080/persons/search` to find out what query methods are exposed, you get back a list of links similar to the following:
+
+```javascript
+{
+ "_links" : {
+ "findByName" : {
+ "href" : "http://localhost:8080/persons/search/findByName"
+ }
+ }
+}
+```
+
+To change the `rel` value, use the `rel` property on the `@RestResource` annotation, as the following example shows:
+
+```java
+@RepositoryRestResource(path = "people")
+interface PersonRepository extends CrudRepository {
+
+ @RestResource(path = "names", rel = "names")
+ List findByName(String name);
+}
+```
+
+The preceding example results in the following link value:
+
+```javascript
+{
+ "_links" : {
+ "names" : {
+ "href" : "http://localhost:8080/persons/search/names"
+ }
+ }
+}
+```
+
+> [!NOTE]
+> These snippets of JSON assume you use Spring Data REST’s default format of [HAL](https://stateless.co/hal_specification.html). You can turn off HAL, which would cause the output to look different. However, your ability to override `rel` names is totally independent of the rendering format.
+
+You can change the `rel` of a repository, as the following example shows:
+
+```java
+@RepositoryRestResource(path = "people", rel = "people")
+interface PersonRepository extends CrudRepository {
+
+ @RestResource(path = "names", rel = "names")
+ List findByName(String name);
+}
+```
+
+Altering the `rel` of a repository changes the top-level name, as the following example output shows:
+
+```javascript
+{
+ "_links" : {
+ "people" : {
+ "href" : "http://localhost:8080/people"
+ },
+ …
+ }
+}
+```
+
+In the top level fragment shown in the preceding output:
+
+- `path = "people"` changed the value in `href` from `/persons` to `/people`.
+- `rel = "people"` changed the name of that link from `persons` to `people`.
+
+When you navigate to the `search` resource of this repository, the finder method’s `@RestResource` annotation has altered the path, as follows:
+
+```javascript
+{
+ "_links" : {
+ "names" : {
+ "href" : "http://localhost:8080/people/search/names"
+ }
+ }
+}
+```
+
+This collection of annotations in your repository definition has caused the following changes:
+
+- The Repository-level annotation’s `path = "people"` is reflected in the base URI with `/people`.
+- The inclusion of a finder method provides you with `/people/search`.
+- `path = "names"` creates a URI of `/people/search/names`.
+- `rel = "names"` changes the name of that link from `findByNames` to `names`.
+
+
+
+## Hiding Certain Repositories, Query Methods, or Fields
+
+You may not want a certain repository, a query method on a repository, or a field of your entity to be exported at all. Examples include hiding fields like `password` on a `User` object and similar sensitive data. To tell the exporter to not export these items, annotate them with `@RestResource` and set `exported = false`.
+
+For example, to skip exporting a repository, you could create a repository definition similar to the following example:
+
+```java
+@RepositoryRestResource(exported = false)
+interface PersonRepository extends CrudRepository {}
+```
+
+To skip exporting a query method, you can annotate the query method with `@RestResource(exported = false)`, as follows:
+
+```java
+@RepositoryRestResource(path = "people", rel = "people")
+interface PersonRepository extends CrudRepository {
+
+ @RestResource(exported = false)
+ List findByName(String name);
+}
+```
+
+Similarly, to skip exporting a field, you can annotate the field with `@RestResource(exported = false)`, as follows:
+
+```java
+@Entity
+public class Person {
+
+ @Id @GeneratedValue private Long id;
+
+ @OneToMany
+ @RestResource(exported = false)
+ private Map profiles;
+}
+```
+
+> [!WARNING]
+> Projections provide the means to change what is exported and effectively [side-step these settings](#projections-excerpts.hidden-data). If you create any projections against the same domain object, be sure to NOT export the fields.
+
+
+
+## Hiding Repository CRUD Methods
+
+If you do not want to expose a save or delete method on your `CrudRepository`, you can use the `@RestResource(exported = false)` setting by overriding the method you want to turn off and placing the annotation on the overridden version. For example, to prevent HTTP users from invoking the delete methods of `CrudRepository`, override all of them and add the annotation to the overridden methods, as follows:
+
+```java
+@RepositoryRestResource(path = "people", rel = "people")
+interface PersonRepository extends CrudRepository {
+
+ @Override
+ @RestResource(exported = false)
+ void delete(Long id);
+
+ @Override
+ @RestResource(exported = false)
+ void delete(Person entity);
+}
+```
+
+> [!WARNING]
+> It is important that you override *both* `delete` methods. In the interest of faster runtime performance, the exporter currently uses a somewhat naive algorithm for determining which CRUD method to use. You cannot currently turn off the version of `delete` that takes an ID but export the version that takes an entity instance. For the time being, you can either export the `delete` methods or not. If you want turn them off, keep in mind that you have to annotate both versions with `exported = false`.
diff --git a/markdown/data-rest/5.0.0/customizing/custom-jackson-deserialization.md b/markdown/data-rest/5.0.0/customizing/custom-jackson-deserialization.md
new file mode 100644
index 000000000..bab0b48b8
--- /dev/null
+++ b/markdown/data-rest/5.0.0/customizing/custom-jackson-deserialization.md
@@ -0,0 +1,79 @@
+---
+title: "Adding Custom Serializers and Deserializers to Jackson’s `ObjectMapper`"
+source: "ROOT:customizing/custom-jackson-deserialization.adoc"
+---
+
+
+
+# Adding Custom Serializers and Deserializers to Jackson’s `ObjectMapper`
+
+Sometimes, the behavior of the Spring Data REST `ObjectMapper` (which has been specially configured to use intelligent serializers that can turn domain objects into links and back again) may not handle your domain model correctly. You can structure your data in so many ways that you may find your own domain model does not correctly translate to JSON. It is also sometimes not practical in these cases to support a complex domain model in a generic way. Sometimes, depending on the complexity, it is not even possible to offer a generic solution.
+
+To accommodate the largest percentage of the use cases, Spring Data REST tries to render your object graph correctly. It tries to serialize unmanaged beans as normal POJOs, and tries to create links to managed beans where necessary. However, if your domain model does not easily lend itself to reading or writing plain JSON, you may want to configure Jackson’s `ObjectMapper` with your own custom type mappings and (de)serializers.
+
+
+
+## Abstract Class Registration
+
+One key configuration point you might need to hook into is when you use an abstract class (or an interface) in your domain model. Jackson does not, by default, know what implementation to create for an interface. Consider the following example:
+
+```java
+@Entity
+public class MyEntity {
+
+ @OneToMany
+ private List interfaces;
+}
+```
+
+In a default configuration, Jackson has no idea what class to instantiate when POSTing new data to the exporter. You need to tell Jackson either through an annotation or, more cleanly, by registering a type mapping by using a [Module](https://wiki.fasterxml.com/JacksonFeatureModules).
+
+Any `Module` bean declared within the scope of your `ApplicationContext` is picked up by the exporter and registered with its `ObjectMapper`. To add this special abstract class type mapping, you can create a `Module` bean and, in the `setupModule` method, add an appropriate `TypeResolver`, as follows:
+
+```java
+public class MyCustomModule extends SimpleModule {
+
+ private MyCustomModule() {
+ super("MyCustomModule", new Version(1, 0, 0, "SNAPSHOT"));
+ }
+
+ @Override
+ public void setupModule(SetupContext context) {
+ context.addAbstractTypeResolver(
+ new SimpleAbstractTypeResolver().addMapping(MyInterface.class,
+ MyInterfaceImpl.class));
+ }
+}
+```
+
+Once you have access to the `SetupContext` object in your `Module`, you can do all sorts of cool things to configure Jackon’s JSON mapping. You can read more about how [Modules work on Jackson’s wiki](https://wiki.fasterxml.com/JacksonFeatureModules).
+
+
+
+## Adding Custom Serializers for Domain Types
+
+If you want to serialize or deserialize a domain type in a special way, you can register your own implementations with Jackson’s `ObjectMapper`. Then the Spring Data REST exporter transparently handles those domain objects correctly.
+
+To add serializers from your `setupModule` method implementation, you can do something like the following:
+
+```java
+public class MyCustomModule extends SimpleModule {
+
+ …
+
+ @Override
+ public void setupModule(SetupContext context) {
+
+ SimpleSerializers serializers = new SimpleSerializers();
+ SimpleDeserializers deserializers = new SimpleDeserializers();
+
+ serializers.addSerializer(MyEntity.class, new MyEntitySerializer());
+ deserializers.addDeserializer(MyEntity.class, new MyEntityDeserializer());
+
+ context.addSerializers(serializers);
+ context.addDeserializers(deserializers);
+ }
+}
+```
+
+Thanks to the custom module shown in the preceding example, Spring Data REST correctly handles your domain objects when they are too complex for the 80% generic use case that Spring Data REST tries to cover.
diff --git a/markdown/data-rest/5.0.0/customizing/customizing-json-output.md b/markdown/data-rest/5.0.0/customizing/customizing-json-output.md
new file mode 100644
index 000000000..0db353346
--- /dev/null
+++ b/markdown/data-rest/5.0.0/customizing/customizing-json-output.md
@@ -0,0 +1,51 @@
+---
+title: "Customizing the JSON Output"
+source: "ROOT:customizing/customizing-json-output.adoc"
+---
+
+
+
+# Customizing the JSON Output
+
+Sometimes in your application, you need to provide links to other resources from a particular entity. For example, a `Customer` response might be enriched with links to a current shopping cart or links to manage resources related to that entity. Spring Data REST provides integration with [Spring HATEOAS](https://github.com/spring-projects/spring-hateoas) and provides an extension hook that lets you alter the representation of resources that go out to the client.
+
+
+
+## The `RepresentationModelProcessor` Interface
+
+Spring HATEOAS defines a `RepresentationModelProcessor<>` interface for processing entities. All beans of type `RepresentationModelProcessor>` are automatically picked up by the Spring Data REST exporter and triggered when serializing an entity of type `T`.
+
+For example, to define a processor for a `Person` entity, add a `@Bean` similar to the following (which is taken from the Spring Data REST tests) to your `ApplicationContext`:
+
+```java
+@Bean
+public RepresentationModelProcessor> personProcessor() {
+
+ return new RepresentationModelProcessor>() {
+
+ @Override
+ public EntityModel process(EntityModel model) {
+
+ model.add(new Link("http://localhost:8080/people", "added-link"));
+ return model;
+ }
+ };
+}
+```
+
+> [!IMPORTANT]
+> The preceding example hard codes a link to `localhost:8080/people`. If you have a Spring MVC endpoint inside your app to which you wish to link, consider using Spring HATEOAS’s [`linkTo(…)`](https://docs.spring.io/spring-hateoas/docs/current/reference/html/#fundamentals.obtaining-links.builder.methods) method to avoid managing the URL.
+
+
+
+## Adding Links
+
+You can add links to the default representation of an entity by calling `model.add(Link)`, as the preceding example shows. Any links you add to the `EntityModel` are added to the final output.
+
+
+
+## Customizing the Representation
+
+The Spring Data REST exporter runs any discovered `RepresentationModelProcessor` instances before it creates the output representation. It does so by registering a `Converter` instance with an internal `ConversionService`. This is the component responsible for creating the links to referenced entities (such as those objects under the `_links` property in the object’s JSON representation). It takes an `@Entity` and iterates over its properties, creating links for those properties that are managed by a `Repository` and copying across any embedded or simple properties.
+
+If your project needs to have output in a different format, however, you can completely replace the default outgoing JSON representation with your own. If you register your own `ConversionService` in the `ApplicationContext` and register your own `Converter`, you can return a `EntityModel` implementation of your choosing.
diff --git a/markdown/data-rest/5.0.0/customizing/overriding-sdr-response-handlers.md b/markdown/data-rest/5.0.0/customizing/overriding-sdr-response-handlers.md
new file mode 100644
index 000000000..e1eb864e6
--- /dev/null
+++ b/markdown/data-rest/5.0.0/customizing/overriding-sdr-response-handlers.md
@@ -0,0 +1,110 @@
+---
+title: "Overriding Spring Data REST Response Handlers"
+source: "ROOT:customizing/overriding-sdr-response-handlers.adoc"
+---
+
+
+
+# Overriding Spring Data REST Response Handlers
+
+Sometimes, you may want to write a custom handler for a specific resource.
+To take advantage of Spring Data REST’s settings, message converters, exception handling, and more, use the `@RepositoryRestController` annotation instead of a standard Spring MVC `@Controller` or `@RestController`.
+Controllers annotated with `@RepositoryRestController` are served from the API base path defined in `RepositoryRestConfiguration.setBasePath`, which is used by all other RESTful endpoints (for example, `/api`).
+The following example shows how to use the `@RepositoryRestController` annotation:
+
+```java
+@RepositoryRestController
+class ScannerController {
+
+ private final ScannerRepository repository;
+
+ ScannerController(ScannerRepository repository) { // <1>
+ this.repository = repository;
+ }
+
+ @GetMapping(path = "/scanners/search/producers") // <2>
+ ResponseEntity> getProducers() {
+
+ List producers = repository.listProducers(); // <3>
+
+ // do some intermediate processing, logging, etc. with the producers
+
+ CollectionModel resources = CollectionModel.of(producers); // <4>
+
+ resources.add(linkTo(methodOn(ScannerController.class).getProducers()).withSelfRel()); // <5>
+
+ // add other links as needed
+
+ return ResponseEntity.ok(resources); // <6>
+ }
+}
+```
+
+1. This example uses constructor injection.
+1. This handler plugs in a custom handler method as query method resource
+1. This handler uses the underlying repository to fetch data, but then does some form of post processing before returning the final data set to the client.
+1. The results of type T need to be wrapped up in a Spring HATEOAS `CollectionModel` object to return a collection. `EntityModel` or `RepresentationModel` are suitable wrappers for a single item, respectively.
+1. Add a link back to this exact method as a `self` link.
+1. Returning the collection by using Spring MVC’s `ResponseEntity` wrapper ensures that the collection is properly wrapped and rendered in the proper accept type.
+
+`CollectionModel` is for a collection, while `EntityModel` — or the more general class `RepresentationModel` — is for a single item. These types can be combined. If you know the links for each item in a collection, use `CollectionModel>` (or whatever the core domain type is rather than `String`). Doing so lets you assemble links for each item as well as for the whole collection.
+
+> [!IMPORTANT]
+> In this example, the combined path is `RepositoryRestConfiguration.getBasePath()` + `/scanners/search/producers`.
+
+
+
+## Obtaining Aggregate References
+
+For custom controllers receiving `PUT` and `POST` requests, the request body usually contains a JSON document that will use URIs to express references to other resources.
+For `GET` requests, those references are handed in via a request parameter.
+
+As of Spring Data REST 4.1, we provide `AggregateReference` to be used as handler method parameter type to capture such references and resolve them into either the referenced aggregate’s identifier, the aggregate itself or a jMolecules `Association`.
+All you need to do is declare an `@RequestParam` of that type and then consume either the identifier or the fully resolved aggregate.
+
+```java
+@RepositoryRestController
+class ScannerController {
+
+ private final ScannerRepository repository;
+
+ ScannerController(ScannerRepository repository) {
+ this.repository = repository;
+ }
+
+ @GetMapping(path = "/scanners")
+ ResponseEntity> getProducers(
+ @RequestParam AggregateReference producer) {
+
+ var identifier = producer.resolveRequiredId();
+ // Alternatively
+ var aggregate = producer.resolveRequiredAggregate();
+ }
+
+ // Alternatively
+
+ @GetMapping(path = "/scanners")
+ ResponseEntity> getProducers(
+ @RequestParam AssociationAggregateReference producer) {
+
+ var association = producer.resolveRequiredAssociation();
+ }
+}
+```
+
+In case you are using jMolecules, `AssociationAggregateReference` also allows you to obtain an `Association`.
+While both of the abstraction assume the value for the parameter to be a URI matching the scheme that Spring Data REST uses to expose item resources, that source value resolution can be customized by calling `….withIdSource(…)` on the reference instance to provide a function to extract the identifier value to be used for aggregate resolution eventually from the `UriComponents` obtained from the URI received.
+
+
+
+## `@RepositoryRestController` VS. `@BasePathAwareController`
+
+If you are not interested in entity-specific operations but still want to build custom operations underneath `basePath`, such as Spring MVC views, resources, and others, use `@BasePathAwareController`.
+If you’re using `@RepositoryRestController` on your custom controller, it will only handle the request if your request mappings blend into the URI space used by the repository.
+It will also apply the following extra functionality to the controller methods:
+
+1. CORS configuration according as defined for the repository mapped to the base path segment used in the request mapping of the handler method.
+1. Apply an `OpenEntityManagerInViewInterceptor` if JPA is used to make sure you can access properties marked as to be resolved lazily.
+
+> [!WARNING]
+> If you use `@Controller` or `@RestController` for anything, that code is totally outside the scope of Spring Data REST. This extends to request handling, message converters, exception handling, and other uses.
diff --git a/markdown/data-rest/5.0.0/etags-and-other-conditionals.md b/markdown/data-rest/5.0.0/etags-and-other-conditionals.md
new file mode 100644
index 000000000..018e3af62
--- /dev/null
+++ b/markdown/data-rest/5.0.0/etags-and-other-conditionals.md
@@ -0,0 +1,114 @@
+---
+title: "Conditional Operations with Headers"
+source: "ROOT:etags-and-other-conditionals.adoc"
+---
+
+
+
+# Conditional Operations with Headers
+
+This section shows how Spring Data REST uses standard HTTP headers to enhance performance, conditionalize operations, and contribute to a more sophisticated frontend.
+
+
+
+## `ETag`, `If-Match`, and `If-None-Match` Headers
+
+The [`ETag` header](https://tools.ietf.org/html/rfc7232#section-2.3) provides a way to tag resources. This can prevent clients from overriding each other while also making it possible to reduce unnecessary calls.
+
+Consider the following example:
+
+```java
+class Sample {
+
+ @Version Long version; // <1>
+
+ Sample(Long version) {
+ this.version = version;
+ }
+}
+```
+
+1. The `@Version` annotation (the JPA one in case you’re using Spring Data JPA, the Spring Data `org.springframework.data.annotation.Version` one for all other modules) flags this field as a version marker.
+
+The POJO in the preceding example, when served up as a REST resource by Spring Data REST, has an `ETag` header with the value of the version field.
+
+We can conditionally `PUT`, `PATCH`, or `DELETE` that resource if we supply a `If-Match` header such as the following:
+
+```
+curl -v -X PATCH -H 'If-Match: ' ...
+```
+
+Only if the resource’s current `ETag` state matches the `If-Match` header is the operation carried out. This safeguard prevents clients from stomping on each other. Two different clients can fetch the resource and have an identical `ETag`. If one client updates the resource, it gets a new `ETag` in the response. But the first client still has the old header. If that client attempts an update with the `If-Match` header, the update fails because they no longer match. Instead, that client receives an HTTP `412 Precondition Failed` message to be sent back. The client can then catch up however is necessary.
+
+> [!WARNING]
+> The term, “version,” may carry different semantics with different data stores and even different semantics within your application. Spring Data REST effectively delegates to the data store’s metamodel to discern if a field is versioned and, if so, only allows the listed updates if `ETag` elements match.
+
+The [`If-None-Match` header](https://tools.ietf.org/html/rfc7232#section-3.2) provides an alternative. Instead of conditional updates, `If-None-Match` allows conditional queries. Consider the following example:
+
+```
+curl -v -H 'If-None-Match: ' ...
+```
+
+The preceding command (by default) runs a `GET`. Spring Data REST checks for `If-None-Match` headers while doing a `GET`. If the header matches the ETag, it concludes that nothing has changed and, instead of sending a copy of the resource, sends back an HTTP `304 Not Modified` status code. Semantically, it reads “If this supplied header value does not match the server-side version, send the whole resource. Otherwise, do not send anything.”
+
+> [!NOTE]
+> This POJO is from an `ETag`-based unit test, so it does not have `@Entity` (JPA) or `@Document` (MongoDB) annotations, as expected in application code. It focuses solely on how a field with `@Version` results in an `ETag` header.
+
+
+
+## `If-Modified-Since` header
+
+The [`If-Modified-Since` header](https://tools.ietf.org/html/rfc7232#section-3.3) provides a way to check whether a resource has been updated since the last request, which lets applications avoid resending the same data. Consider the following example:
+
+```java
+@Document
+public class Receipt {
+
+ public @Id String id;
+ public @Version Long version;
+ public @LastModifiedDate Date date; // <1>
+
+ public String saleItem;
+ public BigDecimal amount;
+
+}
+```
+
+1. Spring Data Commons’s `@LastModifiedDate` annotation allows capturing this information in multiple formats (JodaTime’s `DateTime`, legacy Java `Date` and `Calendar`, JDK8 date/time types, and `long`/`Long`).
+
+With the date field in the preceding example, Spring Data REST returns a `Last-Modified` header similar to the following:
+
+```
+Last-Modified: Wed, 24 Jun 2015 20:28:15 GMT
+```
+
+This value can be captured and used for subsequent queries to avoid fetching the same data twice when it has not been updated, as the following example shows:
+
+```
+curl -H "If-Modified-Since: Wed, 24 Jun 2015 20:28:15 GMT" ...
+```
+
+With the preceding command, you are asking that a resource be fetched only if it has changed since the specified time. If so, you get a revised `Last-Modified` header with which to update the client. If not, you receive an HTTP `304 Not Modified` status code.
+
+The header is perfectly formatted to send back for a future query.
+
+> [!WARNING]
+> Do not mix and match header value with different queries. Results could be disastrous. Use the header values ONLY when you request the exact same URI and parameters.
+
+
+
+## Architecting a More Efficient Front End
+
+`ETag` elements, combined with the `If-Match` and `If-None-Match` headers, let you build a front end that is more friendly to consumers' data plans and mobile battery lives. To do so:
+
+1. Identify the entities that need locking and add a version attribute.
+
+ HTML5 nicely supports `data-*` attributes, so store the version in the DOM (somewhere such as an `data-etag` attribute).
+1. Identify the entries that would benefit from tracking the most recent updates. When fetching these resources, store the `Last-Modified` value in the DOM (`data-last-modified` perhaps).
+1. When fetching resources, also embed `self` URIs in your DOM nodes (perhaps `data-uri` or `data-self`) so that it is easy to go back to the resource.
+1. Adjust `PUT`/`PATCH`/`DELETE` operations to use `If-Match` and also handle HTTP `412 Precondition Failed` status codes.
+1. Adjust `GET` operations to use `If-None-Match` and `If-Modified-Since` and handle HTTP `304 Not Modified` status codes.
+
+By embedding `ETag` elements and `Last-Modified` values in your DOM (or perhaps elsewhere for a native mobile app), you can then reduce the consumption of data and battery power by not retrieving the same thing over and over. You can also avoid colliding with other clients and, instead, be alerted when you need to reconcile differences.
+
+In this fashion, with just a little tweaking on your front end and some entity-level edits, the backend serves up time-sensitive details you can cash in on when building a customer-friendly client.
diff --git a/markdown/data-rest/5.0.0/events.md b/markdown/data-rest/5.0.0/events.md
new file mode 100644
index 000000000..3e69d097a
--- /dev/null
+++ b/markdown/data-rest/5.0.0/events.md
@@ -0,0 +1,88 @@
+---
+title: "Events"
+source: "ROOT:events.adoc"
+---
+
+
+
+# Events
+
+The REST exporter emits eight different events throughout the process of working with an entity:
+
+- [`BeforeCreateEvent`](https://docs.spring.io/spring-data/rest/docs/5.0.0/api/org/springframework/data/rest/core/event/BeforeCreateEvent.html)
+- [`AfterCreateEvent`](https://docs.spring.io/spring-data/rest/docs/5.0.0/api/org/springframework/data/rest/core/event/AfterCreateEvent.html)
+- [`BeforeSaveEvent`](https://docs.spring.io/spring-data/rest/docs/5.0.0/api/org/springframework/data/rest/core/event/BeforeSaveEvent.html)
+- [`AfterSaveEvent`](https://docs.spring.io/spring-data/rest/docs/5.0.0/api/org/springframework/data/rest/core/event/AfterSaveEvent.html)
+- [`BeforeLinkSaveEvent`](https://docs.spring.io/spring-data/rest/docs/5.0.0/api/org/springframework/data/rest/core/event/BeforeLinkSaveEvent.html)
+- [`AfterLinkSaveEvent`](https://docs.spring.io/spring-data/rest/docs/5.0.0/api/org/springframework/data/rest/core/event/AfterLinkSaveEvent.html)
+- [`BeforeDeleteEvent`](https://docs.spring.io/spring-data/rest/docs/5.0.0/api/org/springframework/data/rest/core/event/BeforeDeleteEvent.html)
+- [`AfterDeleteEvent`](https://docs.spring.io/spring-data/rest/docs/5.0.0/api/org/springframework/data/rest/core/event/AfterDeleteEvent.html)
+
+
+
+## Writing an `ApplicationListener`
+
+You can subclass an abstract class that listens for these kinds of events and calls the appropriate method based on the event type. To do so, override the methods for the events in question, as follows:
+
+```java
+public class BeforeSaveEventListener extends AbstractRepositoryEventListener {
+
+ @Override
+ public void onBeforeSave(Object entity) {
+ ... logic to handle inspecting the entity before the Repository saves it
+ }
+
+ @Override
+ public void onAfterDelete(Object entity) {
+ ... send a message that this entity has been deleted
+ }
+}
+```
+
+One thing to note with this approach, however, is that it makes no distinction based on the type of the entity. You have to inspect that yourself.
+
+
+
+## Writing an Annotated Handler
+
+Another approach is to use an annotated handler, which filters events based on domain type.
+
+To declare a handler, create a POJO and put the `@RepositoryEventHandler` annotation on it. This tells the `BeanPostProcessor` that this class needs to be inspected for handler methods.
+
+Once the `BeanPostProcessor` finds a bean with this annotation, it iterates over the exposed methods and looks for annotations that correspond to the event in question. For example, to handle `BeforeSaveEvent` instances in an annotated POJO for different kinds of domain types, you could define your class as follows:
+
+```java
+@RepositoryEventHandler <1>
+public class PersonEventHandler {
+
+ @HandleBeforeSave
+ public void handlePersonSave(Person p) {
+ // … you can now deal with Person in a type-safe way
+ }
+
+ @HandleBeforeSave
+ public void handleProfileSave(Profile p) {
+ // … you can now deal with Profile in a type-safe way
+ }
+}
+```
+
+1. It’s possible to narrow the types to which this handler applies by using (for example) `@RepositoryEventHandler(Person.class)`.
+
+The domain type whose events you are interested in is determined from the type of the first parameter of the annotated methods.
+
+To register your event handler, either mark the class with one of Spring’s `@Component` stereotypes (so that it can be picked up by `@SpringBootApplication` or `@ComponentScan`) or declare an instance of your annotated bean in your `ApplicationContext`. Then the `BeanPostProcessor` that is created in `RepositoryRestMvcConfiguration` inspects the bean for handlers and wires them to the correct events. The following example shows how to create an event handler for the `Person` class:
+
+```java
+@Configuration
+public class RepositoryConfiguration {
+
+ @Bean
+ PersonEventHandler personEventHandler() {
+ return new PersonEventHandler();
+ }
+}
+```
+
+> [!NOTE]
+> Spring Data REST events are customized [Spring application events](https://docs.spring.io/spring-framework/reference/7.0/core.html#context-functionality-events). By default, Spring events are synchronous, unless they get republished across a boundary (such as issuing a WebSocket event or crossing into a thread).
diff --git a/markdown/data-rest/5.0.0/index.md b/markdown/data-rest/5.0.0/index.md
new file mode 100644
index 000000000..fd000ac80
--- /dev/null
+++ b/markdown/data-rest/5.0.0/index.md
@@ -0,0 +1,66 @@
+---
+title: "Spring Data REST"
+source: "ROOT:index.adoc"
+---
+
+
+
+# Spring Data REST
+
+*Spring Data REST exports Spring Data repositories as REST resources through WebMVC.
+It eases development of applications with a consistent programming model backed by Spring Data modules sources.*
+
+**[Introduction](intro.md) **
+
+Introduction to Spring Data REST and Examples
+
+**[Repository Resources](repository-resources.md) **
+
+Exporting Repositories as REST Resources
+
+**[Representations](representations.md) **
+
+Domain Object Representations (Object Mapping)
+
+**[Conditionals](etags-and-other-conditionals.md) **
+
+Conditional Operations with ETag and other Headers
+
+**[Validation](validation.md) **
+
+Validator Integration
+
+**[Events](events.md) **
+
+Listening to REST Events
+
+**[Integration](integration.md) **
+
+Integration with Spring Data REST components
+
+**[Metadata](metadata.md) **
+
+ALPS and JSON Schema
+
+**[Security](security.md) **
+
+Spring Security Integration
+
+**[Tools](tools.md) **
+
+HAL Explorer
+
+**[Customizing](customizing-sdr.md) **
+
+Tutorials and Recipes to customize Spring Data REST
+
+**[Wiki](https://github.com/spring-projects/spring-data-commons/wiki) **
+
+What’s New,
+Upgrade Notes, Supported Versions, additional cross-version information.
+
+Jon Brisbin, Oliver Drotbohm, Greg Turnquist, Jay Bryant
+
+© 2008-2025 VMware, Inc.
+
+Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.
diff --git a/markdown/data-rest/5.0.0/integration.md b/markdown/data-rest/5.0.0/integration.md
new file mode 100644
index 000000000..20e1cbd03
--- /dev/null
+++ b/markdown/data-rest/5.0.0/integration.md
@@ -0,0 +1,49 @@
+---
+title: "Integration"
+source: "ROOT:integration.adoc"
+---
+
+
+
+# Integration
+
+This section details various ways to integrate with Spring Data REST components, whether from a Spring application that is using Spring Data REST or from other means.
+
+
+
+## Programmatic Links
+
+Sometimes you need to add links to exported resources in your own custom-built Spring MVC controllers. There are three basic levels of linking available:
+
+- Manually assembling links.
+- Using Spring HATEOAS’s [`LinkBuilder`](https://docs.spring.io/spring-hateoas/docs/current/reference/html/#fundamentals.obtaining-links.builder) with `linkTo()`, `slash()`, and so on.
+- Using Spring Data REST’s implementation of [`RepositoryEntityLinks`](https://docs.spring.io/spring-data/rest/docs/5.0.0/api/org/springframework/data/rest/webmvc/support/RepositoryEntityLinks.html).
+
+The first suggestion is terrible and should be avoided at all costs. It makes your code brittle and high-risk. The second is handy when creating links to other hand-written Spring MVC controllers. The last one, which we explore in the rest of this section, is good for looking up resource links that are exported by Spring Data REST.
+
+Consider the following class ,which uses Spring’s autowiring:
+
+```java
+public class MyWebApp {
+
+ private RepositoryEntityLinks entityLinks;
+
+ @Autowired
+ public MyWebApp(RepositoryEntityLinks entityLinks) {
+ this.entityLinks = entityLinks;
+ }
+}
+```
+
+With the class in the preceding example, you can use the following operations:
+
+| Method | Description |
+| --- | --- |
+| `entityLinks.linkToCollectionResource(Person.class)` | Provide a link to the collection resource of the specified type (`Person`, in this case). |
+| `entityLinks.linkToItemResource(Person.class, 1)` | Provide a link to a single resource. |
+| `entityLinks.linkToPagedResource(Person.class, new PageRequest(…))` | Provide a link to a paged resource. |
+| `entityLinks.linksToSearchResources(Person.class)` | Provides a list of links for all the finder methods exposed by the corresponding repository. |
+| `entityLinks.linkToSearchResource(Person.class, "findByLastName")` | Provide a finder link by `rel` (that is, the name of the finder). |
+
+> [!NOTE]
+> All of the search-based links support extra parameters for paging and sorting. See [`RepositoryEntityLinks`](https://docs.spring.io/spring-data/rest/docs/5.0.0/api/org/springframework/data/rest/webmvc/support/RepositoryEntityLinks.html) for the details. There is also `linkFor(Class> type)`, but that returns a Spring HATEOAS `LinkBuilder`, which returns you to the lower level API. Try to use the other ones first.
diff --git a/markdown/data-rest/5.0.0/intro.md b/markdown/data-rest/5.0.0/intro.md
new file mode 100644
index 000000000..72161abb2
--- /dev/null
+++ b/markdown/data-rest/5.0.0/intro.md
@@ -0,0 +1,12 @@
+---
+title: "Introduction"
+source: "ROOT:intro.adoc"
+---
+
+
+
+# Introduction
+
+REST web services have become the number one means for application integration on the web. In its core, REST defines that a system that consists of resources with which clients interact. These resources are implemented in a hypermedia-driven way. [Spring MVC](https://docs.spring.io/spring-framework/reference/7.0/web.html#spring-web) and [Spring WebFlux](https://docs.spring.io/spring-framework/reference/7.0/web-reactive.html#spring-webflux) each offer a solid foundation to build these kinds of services. However, implementing even the simplest tenet of REST web services for a multi-domain object system can be quite tedious and result in a lot of boilerplate code.
+
+Spring Data REST builds on top of the Spring Data repositories and automatically exports those as REST resources. It leverages hypermedia to let clients automatically find functionality exposed by the repositories and integrate these resources into related hypermedia-based functionality.
diff --git a/markdown/data-rest/5.0.0/introduction/example-api-usage-with-curl.md b/markdown/data-rest/5.0.0/introduction/example-api-usage-with-curl.md
new file mode 100644
index 000000000..73cb43ba6
--- /dev/null
+++ b/markdown/data-rest/5.0.0/introduction/example-api-usage-with-curl.md
@@ -0,0 +1,15 @@
+---
+title: "Using cURL to talk to Spring Data REST"
+source: "ROOT:introduction/example-api-usage-with-curl.adoc"
+---
+
+
+
+# Using cURL to talk to Spring Data REST
+
+This appendix contains a list of guides that demonstrate interacting with a Spring Data REST service over cURL:
+
+- [Accessing JPA Data with REST](https://spring.io/guides/gs/accessing-data-rest/)
+- [Accessing Neo4j Data with REST](https://spring.io/guides/gs/accessing-neo4j-data-rest/)
+- [Accessing MongoDB Data with REST](https://spring.io/guides/gs/accessing-mongodb-data-rest/)
+- [Accessing GemFire Data with REST](https://spring.io/guides/gs/accessing-gemfire-data-rest/)
diff --git a/markdown/data-rest/5.0.0/introduction/getting-started.md b/markdown/data-rest/5.0.0/introduction/getting-started.md
new file mode 100644
index 000000000..9786bbff9
--- /dev/null
+++ b/markdown/data-rest/5.0.0/introduction/getting-started.md
@@ -0,0 +1,203 @@
+---
+title: "Getting started"
+source: "ROOT:introduction/getting-started.adoc"
+---
+
+
+
+# Getting started
+
+Spring Data REST is itself a Spring MVC application and is designed in such a way that it should integrate with your existing Spring MVC applications with little effort. An existing (or future) layer of services can run alongside Spring Data REST with only minor additional work.
+
+
+
+## Adding Spring Data REST to a Spring Boot Project
+
+The simplest way to get to started is to build a Spring Boot application because Spring Boot has a starter for Spring Data REST and uses auto-configuration. The following example shows how to use Gradle to include Spring Data Rest in a Spring Boot project:
+
+```groovy
+dependencies {
+ ...
+ implementation("org.springframework.boot:spring-boot-starter-data-rest")
+ ...
+}
+```
+
+The following example shows how to use Maven to include Spring Data Rest in a Spring Boot project:
+
+```xml
+
+ ...
+
+ org.springframework.boot
+ spring-boot-starter-data-rest
+
+ ...
+
+```
+
+> [!NOTE]
+> You need not supply the version number if you use the [Spring Boot Gradle plugin](https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#build-tool-plugins-gradle-plugin) or the [Spring Boot Maven plugin](https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#build-tool-plugins-maven-plugin).
+
+When you use Spring Boot, Spring Data REST gets configured automatically.
+
+
+
+## Adding Spring Data REST to a Gradle project
+
+To add Spring Data REST to a Gradle-based project, add the `spring-data-rest-webmvc` artifact to your compile-time dependencies, as follows:
+
+```groovy
+dependencies {
+ … other project dependencies
+ implementation("org.springframework.data:spring-data-rest-webmvc:5.0.0")
+}
+```
+
+
+
+## Adding Spring Data REST to a Maven project
+
+To add Spring Data REST to a Maven-based project, add the `spring-data-rest-webmvc` artifact to your compile-time dependencies, as follows:
+
+```xml
+
+ org.springframework.data
+ spring-data-rest-webmvc
+ 5.0.0
+
+```
+
+
+
+## Configuring Spring Data REST
+
+To install Spring Data REST alongside your existing Spring MVC application, you need to include the appropriate MVC configuration.
+Spring Data REST configuration is defined in a class called `RepositoryRestMvcConfiguration` and you can import that class into your application’s configuration.
+
+> [!IMPORTANT]
+> This step is unnecessary if you use Spring Boot’s auto-configuration. Spring Boot automatically enables Spring Data REST when you include **spring-boot-starter-data-rest** and, in your list of dependencies, your app is flagged with either `@SpringBootApplication` or `@EnableAutoConfiguration`.
+
+To customize the configuration, register a `RepositoryRestConfigurer` and implement or override the `configure…`-methods relevant to your use case.
+
+Make sure you also configure Spring Data repositories for the store you use. For details on that, see the reference documentation for the [corresponding Spring Data module](https://projects.spring.io/spring-data/).
+
+
+
+## Basic Settings for Spring Data REST
+
+This section covers the basic settings that you can manipulate when you configure a Spring Data REST application, including:
+
+- [Setting the Repository Detection Strategy](#getting-started.setting-repository-detection-strategy)
+- [Changing the Base URI](#getting-started.changing-base-uri)
+- [Changing Other Spring Data REST Properties](#getting-started.changing-other-properties)
+
+
+
+### Setting the Repository Detection Strategy
+
+Spring Data REST uses a `RepositoryDetectionStrategy` to determine whether a repository is exported as a REST resource. The `RepositoryDiscoveryStrategies` enumeration includes the following values:
+
+| | |
+| --- | --- |
+| Name | Description |
+| `DEFAULT` | Exposes all public repository interfaces but considers the `exported` flag of `@(Repository)RestResource`. |
+| `ALL` | Exposes all repositories independently of type visibility and annotations. |
+| `ANNOTATED` | Only repositories annotated with `@(Repository)RestResource` are exposed, unless their `exported` flag is set to `false`. |
+| `VISIBILITY` | Only public repositories annotated are exposed. |
+
+
+
+### Changing the Base URI
+
+By default, Spring Data REST serves up REST resources at the root URI, '/'. There are multiple ways to change the base path.
+
+With Spring Boot 1.2 and later versions, you can do change the base URI by setting a single property in `application.properties`, as follows:
+
+```properties
+spring.data.rest.basePath=/api
+```
+
+With Spring Boot 1.1 or earlier, or if you are not using Spring Boot, you can do the following:
+
+```java
+@Configuration
+class CustomRestMvcConfiguration {
+
+ @Bean
+ public RepositoryRestConfigurer repositoryRestConfigurer() {
+
+ return new RepositoryRestConfigurer() {
+
+ @Override
+ public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config, CorsRegistry cors) {
+ config.setBasePath("/api");
+ }
+ };
+ }
+}
+```
+
+Alternatively, you can register a custom implementation of `RepositoryRestConfigurer` as a Spring bean and make sure it gets picked up by component scanning, as follows:
+
+```java
+@Component
+public class CustomizedRestMvcConfiguration extends RepositoryRestConfigurer {
+
+ @Override
+ public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config, CorsRegistry cors) {
+ config.setBasePath("/api");
+ }
+}
+```
+
+Both of the preceding approaches change the base path to `/api`.
+
+
+
+### Changing Other Spring Data REST Properties
+
+You can alter the following properties:
+
+| | |
+| --- | --- |
+| Property | Description |
+| `basePath` | the root URI for Spring Data REST |
+| `defaultPageSize` | change the default for the number of items served in a single page |
+| `maxPageSize` | change the maximum number of items in a single page |
+| `pageParamName` | change the name of the query parameter for selecting pages |
+| `limitParamName` | change the name of the query parameter for the number of items to show in a page |
+| `sortParamName` | change the name of the query parameter for sorting |
+| `defaultMediaType` | change the default media type to use when none is specified |
+| `returnBodyOnCreate` | change whether a body should be returned when creating a new entity |
+| `returnBodyOnUpdate` | change whether a body should be returned when updating an entity |
+
+
+
+## Starting the Application
+
+At this point, you must also configure your key data store.
+
+Spring Data REST officially supports:
+
+- [Spring Data JPA](https://projects.spring.io/spring-data-jpa/)
+- [Spring Data MongoDB](https://projects.spring.io/spring-data-mongodb/)
+- [Spring Data Neo4j](https://projects.spring.io/spring-data-neo4j/)
+- [Spring Data GemFire](https://projects.spring.io/spring-data-gemfire/)
+- [Spring Data Cassandra](https://projects.spring.io/spring-data-cassandra/)
+
+The following Getting Started guides can help you get up and running quickly:
+
+- [Spring Data JPA](https://spring.io/guides/gs/accessing-data-rest/)
+- [Spring Data MongoDB](https://spring.io/guides/gs/accessing-mongodb-data-rest/)
+- [Spring Data Neo4j](https://spring.io/guides/gs/accessing-neo4j-data-rest/)
+- [Spring Data GemFire](https://spring.io/guides/gs/accessing-gemfire-data-rest/)
+
+These linked guides introduce how to add dependencies for the related data store, configure domain objects, and define repositories.
+
+You can run your application as either a Spring Boot app (with the links shown earlier) or configure it as a classic Spring MVC app.
+
+> [!NOTE]
+> In general, Spring Data REST does not add functionality to a given data store. This means that, by definition, it should work with any Spring Data project that supports the repository programming model. The data stores listed above are the ones for which we have written integration tests to verify that Spring Data REST works with them.
+
+From this point, you can [customize Spring Data REST](../customizing-sdr.md) with various options.
diff --git a/markdown/data-rest/5.0.0/introduction/spring-data-rest-examples.md b/markdown/data-rest/5.0.0/introduction/spring-data-rest-examples.md
new file mode 100644
index 000000000..06902cb7e
--- /dev/null
+++ b/markdown/data-rest/5.0.0/introduction/spring-data-rest-examples.md
@@ -0,0 +1,37 @@
+---
+title: "Spring Data REST example projects"
+source: "ROOT:introduction/spring-data-rest-examples.adoc"
+---
+
+
+
+# Spring Data REST example projects
+
+This appendix contains a list of Spring Data REST sample applications. The exact version of each example is not guaranteed to match the version of this reference manual.
+
+> [!NOTE]
+> To get them all, visit [github.com/spring-projects/spring-data-examples](https://github.com/spring-projects/spring-data-examples) and either clone or download a zipball. Doing so gives you example applications for all supported Spring Data projects. To see them, navigate to `spring-data-examples/rest`.
+
+
+
+## Multi-store Example
+
+[This example](https://github.com/spring-projects/spring-data-examples/tree/master/rest/multi-store) shows how to mix together several underlying Spring Data projects.
+
+
+
+## Projections
+
+[This example](https://github.com/spring-projects/spring-data-examples/tree/master/rest/projections) contains more detailed code you can use to explore [projections](../projections-excerpts.md).
+
+
+
+## Spring Data REST with Spring Security
+
+[This example](https://github.com/spring-projects/spring-data-examples/tree/master/rest/security) shows how to secure a [Spring Data REST](https://projects.spring.io/spring-data-rest) application in multiple ways with [Spring Security](https://projects.spring.io/spring-security).
+
+
+
+## Starbucks example
+
+[This example](https://github.com/spring-projects/spring-data-examples/tree/master/rest/starbucks) exposes 10,843 Starbucks coffee shops through a RESTful API that allows access to the stores in a hypermedia-based way and exposes a resource to run a geo-location search for coffee shops.
diff --git a/markdown/data-rest/5.0.0/introduction/upgrade.md b/markdown/data-rest/5.0.0/introduction/upgrade.md
new file mode 100644
index 000000000..e8a5e0210
--- /dev/null
+++ b/markdown/data-rest/5.0.0/introduction/upgrade.md
@@ -0,0 +1,13 @@
+---
+title: "Upgrading Spring Data"
+source: "ROOT:introduction/upgrade.adoc"
+---
+
+
+
+# Upgrading Spring Data
+
+Instructions for how to upgrade from earlier versions of Spring Data are provided on the project [wiki](https://github.com/spring-projects/spring-data-commons/wiki).
+Follow the links in the [release notes section](https://github.com/spring-projects/spring-data-commons/wiki#release-notes) to find the version that you want to upgrade to.
+
+Upgrading instructions are always the first item in the release notes. If you are more than one release behind, please make sure that you also review the release notes of the versions that you jumped.
diff --git a/markdown/data-rest/5.0.0/metadata.md b/markdown/data-rest/5.0.0/metadata.md
new file mode 100644
index 000000000..ca2545bd2
--- /dev/null
+++ b/markdown/data-rest/5.0.0/metadata.md
@@ -0,0 +1,401 @@
+---
+title: "Metadata"
+source: "ROOT:metadata.adoc"
+---
+
+
+
+# Metadata
+
+This section details the various forms of metadata provided by a Spring Data REST-based application.
+
+
+
+## Application-Level Profile Semantics (ALPS)
+
+> [ALPS](http://alps.io/) is a data format for defining simple descriptions of application-level semantics, similar in complexity to HTML microformats. An ALPS document can be used as a profile to explain the application semantics of a document with an application-agnostic media type (such as HTML, HAL, Collection+JSON, Siren, etc.). This increases the reusability of profile documents across media types.
+>
+> — M. Admundsen / L. Richardson / M. Foster, https://tools.ietf.org/html/draft-amundsen-richardson-foster-alps-00
+
+Spring Data REST provides an ALPS document for every exported repository. It contains information about both the RESTful transitions
+and the attributes of each repository.
+
+At the root of a Spring Data REST app is a profile link. Assuming you had an app with both `persons` and related `addresses`, the root
+document would be as follows:
+
+```javascript
+{
+ "_links" : {
+ "persons" : {
+ "href" : "http://localhost:8080/persons"
+ },
+ "addresses" : {
+ "href" : "http://localhost:8080/addresses"
+ },
+ "profile" : {
+ "href" : "http://localhost:8080/profile"
+ }
+ }
+}
+```
+
+A profile link, as defined in [RFC 6906](https://tools.ietf.org/html/rfc6906), is a place to include application-level details. The
+[ALPS draft spec](https://tools.ietf.org/html/draft-amundsen-richardson-foster-alps-00) is meant to define a particular profile format,
+which we explore later in this section.
+
+If you navigate into the profile link at `localhost:8080/profile`, you see content resembling the following:
+
+```javascript
+{
+ "_links" : {
+ "self" : {
+ "href" : "http://localhost:8080/profile"
+ },
+ "persons" : {
+ "href" : "http://localhost:8080/profile/persons"
+ },
+ "addresses" : {
+ "href" : "http://localhost:8080/profile/addresses"
+ }
+ }
+}
+```
+
+> [!IMPORTANT]
+> At the root level, `profile` is a single link and cannot serve up more than one application profile. That
+> is why you must navigate to `/profile` to find a link for each resource’s metadata.
+
+If you navigate to `/profile/persons` and look at the profile data for a `Person` resource, you see content resembling the following example:
+
+```javascript
+{
+ "version" : "1.0",
+ "descriptors" : [ {
+ "id" : "person-representation", <1>
+ "descriptors" : [ {
+ "name" : "firstName",
+ "type" : "SEMANTIC"
+ }, {
+ "name" : "lastName",
+ "type" : "SEMANTIC"
+ }, {
+ "name" : "id",
+ "type" : "SEMANTIC"
+ }, {
+ "name" : "address",
+ "type" : "SAFE",
+ "rt" : "http://localhost:8080/profile/addresses#address"
+ } ]
+ }, {
+ "id" : "create-persons", <2>
+ "name" : "persons", <3>
+ "type" : "UNSAFE", <4>
+ "rt" : "#person-representation" <5>
+ }, {
+ "id" : "get-persons",
+ "name" : "persons",
+ "type" : "SAFE",
+ "rt" : "#person-representation"
+ }, {
+ "id" : "delete-person",
+ "name" : "person",
+ "type" : "IDEMPOTENT",
+ "rt" : "#person-representation"
+ }, {
+ "id" : "patch-person",
+ "name" : "person",
+ "type" : "UNSAFE",
+ "rt" : "#person-representation"
+ }, {
+ "id" : "update-person",
+ "name" : "person",
+ "type" : "IDEMPOTENT",
+ "rt" : "#person-representation"
+ }, {
+ "id" : "get-person",
+ "name" : "person",
+ "type" : "SAFE",
+ "rt" : "#person-representation"
+ } ]
+}
+```
+
+1. A detailed listing of the attributes of a `Person` resource, identified as `#person-representation`, lists the names
+of the attributes.
+1. The supported operations. This one indicates how to create a new `Person`.
+1. The `name` is `persons`, which indicates (because it is plural) that a POST should be applied to the whole collection, not a single `person`.
+1. The `type` is `UNSAFE`, because this operation can alter the state of the system.
+1. The `rt` is `#person-representation`, which indicates that returned resource type will be `Person` resource.
+
+> [!NOTE]
+> This JSON document has a media type of `application/alps+json`. This is different from the previous JSON document, which had
+> a media type of `application/hal+json`. These formats are different and governed by different specs.
+
+You can also find a `profile` link in the collection of `_links` when you examine a collection resource, as the following example shows:
+
+```javascript
+{
+ "_links" : {
+ "self" : {
+ "href" : "http://localhost:8080/persons" <1>
+ },
+ ... other links ...
+ "profile" : {
+ "href" : "http://localhost:8080/profile/persons" <2>
+ }
+ },
+ ...
+}
+```
+
+1. This HAL document respresents the `Person` collection.
+1. It has a **profile** link to the same URI for metadata.
+
+Again, by default, the `profile` link serves up ALPS. However, if you use an [`Accept` header](https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1), it can serve `application/alps+json`.
+
+
+
+### Hypermedia Control Types
+
+ALPS displays types for each hypermedia control. They include:
+
+| Type | Description |
+| --- | --- |
+| SEMANTIC | A state element (such as `HTML.SPAN`, `HTML.INPUT`, and others). |
+| SAFE | A hypermedia control that triggers a safe, idempotent state transition (such as `GET` or `HEAD`). |
+| IDEMPOTENT | A hypermedia control that triggers an unsafe, idempotent state transition (such as `PUT` or `DELETE`). |
+| UNSAFE | A hypermedia control that triggers an unsafe, non-idempotent state transition (such as `POST`). |
+
+In the representation section shown earlier, bits of data from the application are marked as being `SEMANTIC`. The `address` field
+is a link that involves a safe `GET` to retrieve. Consequently, it is marked as being `SAFE`. Hypermedia operations themselves map onto the types as
+shown in the preceding table.
+
+
+
+### ALPS with Projections
+
+If you define any projections, they are also listed in the ALPS metadata. Assuming we also defined `inlineAddress` and `noAddresses`, they
+would appear inside the relevant operations. (See “[Projections](projections-excerpts.md#projections-excerpts.projections)” for the definitions and discussion of these two projections.) That is **GET** would appear in the operations for the whole collection, and **GET** would appear in the operations for a single resource. The following example shows
+the alternate version of the `get-persons` subsection:
+
+```javascript
+...
+ {
+ "id" : "get-persons",
+ "name" : "persons",
+ "type" : "SAFE",
+ "rt" : "#person-representation",
+ "descriptors" : [ { <1>
+ "name" : "projection",
+ "doc" : {
+ "value" : "The projection that shall be applied when rendering the response. Acceptable values available in nested descriptors.",
+ "format" : "TEXT"
+ },
+ "type" : "SEMANTIC",
+ "descriptors" : [ {
+ "name" : "inlineAddress", <2>
+ "type" : "SEMANTIC",
+ "descriptors" : [ {
+ "name" : "address",
+ "type" : "SEMANTIC"
+ }, {
+ "name" : "firstName",
+ "type" : "SEMANTIC"
+ }, {
+ "name" : "lastName",
+ "type" : "SEMANTIC"
+ } ]
+ }, {
+ "name" : "noAddresses", <3>
+ "type" : "SEMANTIC",
+ "descriptors" : [ {
+ "name" : "firstName",
+ "type" : "SEMANTIC"
+ }, {
+ "name" : "lastName",
+ "type" : "SEMANTIC"
+ } ]
+ } ]
+ } ]
+ }
+...
+```
+
+1. A new attribute, `descriptors`, appears, containing an array with one entry, `projection`.
+1. Inside the `projection.descriptors`, we can see `inLineAddress`. It render `address`, `firstName`, and `lastName`.
+Relationships rendered inside a projection result in including the data fields inline.
+1. `noAddresses` serves up a subset that contains `firstName` and `lastName`.
+
+With all this information, a client can deduce not only the available RESTful transitions but also, to some degree, the
+data elements needed to interact with the back end.
+
+
+
+### Adding Custom Details to Your ALPS Descriptions
+
+You can create custom messages that appear in your ALPS metadata. To do so, create `rest-messages.properties`, as follows:
+
+```properties
+rest.description.person=A collection of people
+rest.description.person.id=primary key used internally to store a person (not for RESTful usage)
+rest.description.person.firstName=Person's first name
+rest.description.person.lastName=Person's last name
+rest.description.person.address=Person's address
+```
+
+These `rest.description.*` properties define details to display for a `Person` resource. They alter the ALPS format of the `person-representation`, as follows:
+
+```javascript
+...
+ {
+ "id" : "person-representation",
+ "doc" : {
+ "value" : "A collection of people", <1>
+ "format" : "TEXT"
+ },
+ "descriptors" : [ {
+ "name" : "firstName",
+ "doc" : {
+ "value" : "Person's first name", <2>
+ "format" : "TEXT"
+ },
+ "type" : "SEMANTIC"
+ }, {
+ "name" : "lastName",
+ "doc" : {
+ "value" : "Person's last name", <3>
+ "format" : "TEXT"
+ },
+ "type" : "SEMANTIC"
+ }, {
+ "name" : "id",
+ "doc" : {
+ "value" : "primary key used internally to store a person (not for RESTful usage)", <4>
+ "format" : "TEXT"
+ },
+ "type" : "SEMANTIC"
+ }, {
+ "name" : "address",
+ "doc" : {
+ "value" : "Person's address", <5>
+ "format" : "TEXT"
+ },
+ "type" : "SAFE",
+ "rt" : "http://localhost:8080/profile/addresses#address"
+ } ]
+ }
+...
+```
+
+1. The value of `rest.description.person` maps into the whole representation.
+1. The value of `rest.description.person.firstName` maps to the `firstName` attribute.
+1. The value of `rest.description.person.lastName` maps to the `lastName` attribute.
+1. The value of `rest.description.person.id` maps to the `id` attribute, a field not normally displayed.
+1. The value of `rest.description.person.address` maps to the `address` attribute.
+
+Supplying these property settings causes each field to have an extra `doc` attribute.
+
+> [!NOTE]
+> Spring MVC (which is the essence of a Spring Data REST application) supports locales, meaning you can bundle up multiple
+> properties files with different messages.
+
+
+
+## JSON Schema
+
+[JSON Schema](https://json-schema.org/) is another form of metadata supported by Spring Data REST. Per their website, JSON Schema has the following advantages:
+
+- Describes your existing data format
+- Clear, human- and machine-readable documentation
+- Complete structural validation, useful for automated testing and validating client-submitted data
+
+As shown in the [previous section](#metadata.alps), you can reach this data by navigating from the root URI to the `profile` link.
+
+```javascript
+{
+ "_links" : {
+ "self" : {
+ "href" : "http://localhost:8080/profile"
+ },
+ "persons" : {
+ "href" : "http://localhost:8080/profile/persons"
+ },
+ "addresses" : {
+ "href" : "http://localhost:8080/profile/addresses"
+ }
+ }
+}
+```
+
+These links are the same as shown earlier. To retrieve JSON Schema, you can invoke them with the following `Accept` header: `application/schema+json`.
+
+In this case, if you ran `curl -H 'Accept:application/schema+json' localhost:8080/profile/persons`, you would see output resembling the following:
+
+```javascript
+{
+ "title" : "org.springframework.data.rest.webmvc.jpa.Person", <1>
+ "properties" : { <2>
+ "firstName" : {
+ "readOnly" : false,
+ "type" : "string"
+ },
+ "lastName" : {
+ "readOnly" : false,
+ "type" : "string"
+ },
+ "siblings" : {
+ "readOnly" : false,
+ "type" : "string",
+ "format" : "uri"
+ },
+ "created" : {
+ "readOnly" : false,
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "father" : {
+ "readOnly" : false,
+ "type" : "string",
+ "format" : "uri"
+ },
+ "weight" : {
+ "readOnly" : false,
+ "type" : "integer"
+ },
+ "height" : {
+ "readOnly" : false,
+ "type" : "integer"
+ }
+ },
+ "descriptors" : { },
+ "type" : "object",
+ "$schema" : "https://json-schema.org/draft-04/schema#"
+}
+```
+
+1. The type that was exported
+1. A listing of properties
+
+There are more details if your resources have links to other resources.
+
+You can also find a `profile` link in the collection of `_links` when you examine a collection resource, as the following example shows:
+
+```javascript
+{
+ "_links" : {
+ "self" : {
+ "href" : "http://localhost:8080/persons" <1>
+ },
+ ... other links ...
+ "profile" : {
+ "href" : "http://localhost:8080/profile/persons" <2>
+ }
+ },
+ ...
+}
+```
+
+1. This HAL document respresents the `Person` collection.
+1. It has a **profile** link to the same URI for metadata.
+
+Again, the `profile` link serves [ALPS](#metadata.alps) by default. If you supply it with an [`Accept` header](https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1) of `application/schema+json`, it renders the JSON Schema representation.
diff --git a/markdown/data-rest/5.0.0/paging-and-sorting.md b/markdown/data-rest/5.0.0/paging-and-sorting.md
new file mode 100644
index 000000000..81547d1dd
--- /dev/null
+++ b/markdown/data-rest/5.0.0/paging-and-sorting.md
@@ -0,0 +1,138 @@
+---
+title: "Paging and Sorting"
+source: "ROOT:paging-and-sorting.adoc"
+---
+
+
+
+# Paging and Sorting
+
+This section documents Spring Data REST’s usage of the Spring Data Repository paging and sorting abstractions. To familiarize yourself with those features, see the Spring Data documentation for the repository implementation you use (such as Spring Data JPA).
+
+
+
+## Paging
+
+Rather than return everything from a large result set, Spring Data REST recognizes some URL parameters that influence the page size and the starting page number.
+
+If you extend `PagingAndSortingRepository` and access the list of all entities, you get links to the first 20 entities. To set the page size to any other number, add a `size` parameter, as follows:
+
+```
+http://localhost:8080/people/?size=5
+```
+
+The preceding example sets the page size to 5.
+
+To use paging in your own query methods, you need to change the method signature to accept an additional `Pageable` parameter and return a `Page` or `Slice` rather than a `List`. For example, the following query method is exported to `/people/search/nameStartsWith` and supports paging:
+
+```java
+@RestResource(path = "nameStartsWith", rel = "nameStartsWith")
+public Page findByNameStartsWith(@Param("name") String name, Pageable p);
+```
+
+The Spring Data REST exporter recognizes the returned `Page`/`Slice` and gives you the results in the body of the response, just as it would with a non-paged response, but additional links are added to the resource to represent the previous and next pages of data.
+
+
+
+### Previous and Next Links
+
+Each paged response returns links to the previous and next pages of results based on the current page by using the IANA-defined link relations [`prev`](https://www.w3.org/TR/html5/links.html#link-type-prev) and [`next`](https://www.w3.org/TR/html5/links.html#link-type-next). If you are currently at the first page of results, however, no `prev` link is rendered. For the last page of results, no `next` link is rendered.
+
+Consider the following example, where we set the page size to 5:
+
+```
+curl localhost:8080/people?size=5
+```
+
+```javascript
+{
+ "_links" : {
+ "self" : {
+ "href" : "http://localhost:8080/persons{&sort,page,size}", <1>
+ "templated" : true
+ },
+ "next" : {
+ "href" : "http://localhost:8080/persons?page=1&size=5{&sort}", <2>
+ "templated" : true
+ }
+ },
+ "_embedded" : {
+ … data …
+ },
+ "page" : { <3>
+ "size" : 5,
+ "totalElements" : 50,
+ "totalPages" : 10,
+ "number" : 0
+ }
+}
+```
+
+At the top, we see `_links`:
+
+1. The `self` link serves up the whole collection with some options.
+1. The `next` link points to the next page, assuming the same page size.
+1. At the bottom is extra data about the page settings, including the size of a page, total elements, total pages, and the page number you are currently viewing.
+
+> [!NOTE]
+> When using tools such as `curl` on the command line, if you have a ampersand (`&`) in your statement, you need to wrap the whole URI in quotation marks.
+
+Note that the `self` and `next` URIs are, in fact, URI templates. They accept not only `size`, but also `page` and `sort` as optional flags.
+
+As mentioned earlier, the bottom of the HAL document includes a collection of details about the page. This extra information makes it easy for you to configure UI tools like sliders or indicators to reflect the user’s overall position when they view the data. For example, the document in the preceding example shows we are looking at the first page (with page numbers starting at 0).
+
+The following example shows What happens when we follow the `next` link:
+
+```
+$ curl "http://localhost:8080/persons?page=1&size=5"
+```
+
+```javascript
+{
+ "_links" : {
+ "self" : {
+ "href" : "http://localhost:8080/persons{&sort,projection,page,size}",
+ "templated" : true
+ },
+ "next" : {
+ "href" : "http://localhost:8080/persons?page=2&size=5{&sort,projection}", <1>
+ "templated" : true
+ },
+ "prev" : {
+ "href" : "http://localhost:8080/persons?page=0&size=5{&sort,projection}", <2>
+ "templated" : true
+ }
+ },
+ "_embedded" : {
+ ... data ...
+ },
+ "page" : {
+ "size" : 5,
+ "totalElements" : 50,
+ "totalPages" : 10,
+ "number" : 1 <3>
+ }
+}
+```
+
+This looks very similar, except for the following differences:
+
+1. The `next` link now points to yet another page, indicating its relative perspective to the `self` link.
+1. A `prev` link now appears, giving us a path to the previous page.
+1. The current number is now 1 (indicating the second page).
+
+This feature lets you map optional buttons on the screen to these hypermedia controls, letting you implement navigational features for the UI experience without having to hard code the URIs. In fact, the user can be empowered to pick from a list of page sizes, dynamically changing the content served, without having to rewrite the `next` and `prev controls at the top or bottom.
+
+
+
+## Sorting
+
+Spring Data REST recognizes sorting parameters that use the repository sorting support.
+
+To have your results sorted on a particular property, add a `sort` URL parameter with the name of the property on which you want to sort the results. You can control the direction of the sort by appending a comma (`,`) to the the property name plus either `asc` or `desc`. The following would use the `findByNameStartsWith` query method defined on the `PersonRepository` for all `Person` entities with names starting with the letter “K” and add sort data that orders the results on the `name` property in descending order:
+
+```
+curl -v "http://localhost:8080/people/search/nameStartsWith?name=K&sort=name,desc"
+```
+
+To sort the results by more than one property, keep adding as many `sort=PROPERTY` parameters as you need. They are added to the `Pageable` in the order in which they appear in the query string. Results can be sorted by top-level and nested properties. Use property path notation to express a nested sort property. Sorting by linkable associations (that is, links to top-level resources) is not supported.
diff --git a/markdown/data-rest/5.0.0/projections-excerpts.md b/markdown/data-rest/5.0.0/projections-excerpts.md
new file mode 100644
index 000000000..0bfbc69ef
--- /dev/null
+++ b/markdown/data-rest/5.0.0/projections-excerpts.md
@@ -0,0 +1,332 @@
+---
+title: "Projections and Excerpts"
+source: "ROOT:projections-excerpts.adoc"
+---
+
+
+
+# Projections and Excerpts
+
+Spring Data REST presents a default view of the domain model you export. However, sometimes, you may need to alter the view of that model for various reasons. This section covers how to define projections and excerpts to serve up simplified and reduced views of resources.
+
+
+
+## Projections
+
+Consider the following domain model:
+
+```java
+@Entity
+public class Person {
+
+ @Id @GeneratedValue
+ private Long id;
+ private String firstName, lastName;
+
+ @OneToOne
+ private Address address;
+ …
+}
+```
+
+The `Person` object in the preceding example has several attributes:
+
+- `id` is the primary key.
+- `firstName` and `lastName` are data attributes.
+- `address` is a link to another domain object.
+
+Now assume that we create a corresponding repository, as follows:
+
+```java
+interface PersonRepository extends CrudRepository {}
+```
+
+By default, Spring Data REST exports this domain object, including all of its attributes. `firstName` and `lastName` are exported as the plain data objects that they are. There are two options regarding the `address` attribute. One option is to also define a repository for `Address` objects, as follows:
+
+```java
+interface AddressRepository extends CrudRepository {}
+```
+
+In this situation, a `Person` resource renders the `address` attribute as a URI to its corresponding `Address` resource. If we were to look up “Frodo” in the system, we could expect to see a HAL document like this:
+
+```javascript
+{
+ "firstName" : "Frodo",
+ "lastName" : "Baggins",
+ "_links" : {
+ "self" : {
+ "href" : "http://localhost:8080/persons/1"
+ },
+ "address" : {
+ "href" : "http://localhost:8080/persons/1/address"
+ }
+ }
+}
+```
+
+There is another way. If the `Address` domain object does not have its own repository definition, Spring Data REST includes the data fields inside the `Person` resource, as the following example shows:
+
+```javascript
+{
+ "firstName" : "Frodo",
+ "lastName" : "Baggins",
+ "address" : {
+ "street": "Bag End",
+ "state": "The Shire",
+ "country": "Middle Earth"
+ },
+ "_links" : {
+ "self" : {
+ "href" : "http://localhost:8080/persons/1"
+ }
+ }
+}
+```
+
+But what if you do not want `address` details at all? Again, by default, Spring Data REST exports all of its attributes (except the `id`). You can offer the consumer of your REST service an alternative by defining one or more projections. The following example shows a projection that does not include the address:
+
+```java
+@Projection(name = "noAddresses", types = { Person.class }) <1>
+interface NoAddresses { <2>
+
+ String getFirstName(); <3>
+
+ String getLastName(); <4>
+}
+```
+
+1. The `@Projection` annotation flags this as a projection. The `name` attribute provides
+the name of the projection, which we cover in more detail shortly. The `types` attributes targets this projection to apply only to `Person` objects.
+1. It is a Java interface, making it declarative.
+1. It exports the `firstName`.
+1. It exports the `lastName`.
+
+The `NoAddresses` projection only has getters for `firstName` and `lastName`, meaning that it does not serve up any address information. Assuming you have a separate repository for `Address` resources, the default view from Spring Data REST differs slightly from the previous representation, as the following example shows:
+
+```javascript
+{
+ "firstName" : "Frodo",
+ "lastName" : "Baggins",
+ "_links" : {
+ "self" : {
+ "href" : "http://localhost:8080/persons/1{?projection}", <1>
+ "templated" : true <2>
+ },
+ "address" : {
+ "href" : "http://localhost:8080/persons/1/address"
+ }
+ }
+}
+```
+
+1. This resource has a new option: `{?projection}`.
+1. The `self` URI is a URI Template.
+
+To view the projection to the resource, look up `localhost:8080/persons/1?projection=noAddresses`.
+
+> [!NOTE]
+> The value supplied to the `projection` query parameter is the same as that specified in `@Projection(name = "noAddress")`. It has nothing to do with the name of the projection’s interface.
+
+You can have multiple projections.
+
+> [!NOTE]
+> See [Projections](introduction/spring-data-rest-examples.md#spring-data-examples.projections) to see an example project. We encourage you to experiment with it.
+
+Spring Data REST finds projection definitions as follows:
+
+- Any `@Projection` interface found in the same package as your entity definitions (or one of its sub-packages) is registered.
+- You can manually register a projection by using `RepositoryRestConfiguration.getProjectionConfiguration().addProjection(…)`.
+
+In either case, the projection interface must have the `@Projection` annotation.
+
+
+
+### Finding Existing Projections
+
+Spring Data REST exposes [Application-Level Profile Semantics (ALPS)](metadata.md#metadata.alps) documents, a micro metadata format. To view the ALPS metadata, follow the `profile` link exposed by the root resource. If you navigate down to the ALPS document for `Person` resources (which would be `/alps/persons`), you can find many details about `Person` resources. Projections are listed, along with the details about the `GET` REST transition, in blocks similar to the following example:
+
+```javascript
+{ …
+ "id" : "get-person", <1>
+ "name" : "person",
+ "type" : "SAFE",
+ "rt" : "#person-representation",
+ "descriptors" : [ {
+ "name" : "projection", <2>
+ "doc" : {
+ "value" : "The projection that shall be applied when rendering the response. Acceptable values available in nested descriptors.",
+ "format" : "TEXT"
+ },
+ "type" : "SEMANTIC",
+ "descriptors" : [ {
+ "name" : "noAddresses", <3>
+ "type" : "SEMANTIC",
+ "descriptors" : [ {
+ "name" : "firstName", <4>
+ "type" : "SEMANTIC"
+ }, {
+ "name" : "lastName", <4>
+ "type" : "SEMANTIC"
+ } ]
+ } ]
+ } ]
+},
+…
+```
+
+1. This part of the ALPS document shows details about `GET` and `Person` resources.
+1. This part contais the `projection` options.
+1. This part contains the `noAddresses` projection.
+1. The actual attributes served up by this projection include `firstName` and `lastName`.
+
+> [!NOTE]
+> Projection definitions are picked up and made available for clients if they are:
+>
+> - Flagged with the `@Projection` annotation and located in the same package (or sub-package) of the domain type, OR
+> - Manually registered by using `RepositoryRestConfiguration.getProjectionConfiguration().addProjection(…)`.
+
+
+
+### Bringing in Hidden Data
+
+So far in this section, we have covered how projections can be used to reduce the information that is presented to the user. Projections can also bring in normally unseen data. For example, Spring Data REST ignores fields or getters that are marked up with `@JsonIgnore` annotations. Consider the following domain object:
+
+```java
+@Entity
+public class User {
+
+ @Id @GeneratedValue
+ private Long id;
+ private String name;
+
+ @JsonIgnore private String password; <1>
+
+ private String[] roles;
+ …
+```
+
+1. Jackson’s `@JsonIgnore` is used to prevent the `password` field from being serialized into JSON.
+
+The `User` class in the preceding example can be used to store user information as well as integration with Spring Security. If you create a `UserRepository`, the `password` field would normally have been exported, which is not good. In the preceding example, we prevent that from happening by applying Jackson’s `@JsonIgnore` on the `password` field.
+
+> [!NOTE]
+> Jackson also does not serialize the field into JSON if `@JsonIgnore` is on the field’s corresponding getter function.
+
+However, projections introduce the ability to still serve this field. It is possible to create the following projection:
+
+```java
+@Projection(name = "passwords", types = { User.class })
+interface PasswordProjection {
+
+ String getPassword();
+}
+```
+
+If such a projection is created and used, it sidesteps the `@JsonIgnore` directive placed on `User.password`.
+
+> [!IMPORTANT]
+> This example may seem a bit contrived, but it is possible, with a richer domain model and many projections, to accidentally leak such details. Since Spring Data REST cannot discern the sensitivity of such data, it is up to you to avoid such situations.
+
+Projections can also generate virtual data. Imagine you had the following entity definition:
+
+```java
+@Entity
+public class Person {
+
+ ...
+ private String firstName;
+ private String lastName;
+
+ ...
+}
+```
+
+You can create a projection that combines the two data fields in the preceding example together, as follows:
+
+```java
+@Projection(name = "virtual", types = { Person.class })
+public interface VirtualProjection {
+
+ @Value("#{target.firstName} #{target.lastName}") <1>
+ String getFullName();
+
+}
+```
+
+1. Spring’s `@Value` annotation lets you plug in a SpEL expression that takes the target object and splices together its `firstName` and `lastName` attributes to render a read-only `fullName`.
+
+
+
+## Excerpts
+
+An excerpt is a projection that is automatically applied to a resource collection. For example, you can alter the `PersonRepository` as follows:
+
+```java
+@RepositoryRestResource(excerptProjection = NoAddresses.class)
+interface PersonRepository extends CrudRepository {}
+```
+
+The preceding example directs Spring Data REST to use the `NoAddresses` projection when embedding `Person` resources into collections or related resources.
+
+> [!NOTE]
+> Excerpt projections are not automatically applied to single resources. They have to be applied deliberately. Excerpt projections are meant to provide a default preview of collection data but not when fetching individual resources. See [Why is an excerpt projection not applied automatically for a Spring Data REST item resource?](https://stackoverflow.com/questions/30220333/why-is-an-excerpt-projection-not-applied-automatically-for-a-spring-data-rest-it) for a discussion on the subject.
+
+In addition to altering the default rendering, excerpts have additional rendering options as shown in the next section.
+
+
+
+### Excerpting Commonly Accessed Data
+
+A common situation with REST services arises when you compose domain objects. For example, a `Person` is stored in one table and their related `Address` is stored in another. By default, Spring Data REST serves up the person’s `address` as a URI the client must navigate. But if it is common for consumers to always fetch this extra piece of data, an excerpt projection can put this extra piece of data inline, saving you an extra `GET`. To do so, you can define another excerpt projection, as follows:
+
+```java
+@Projection(name = "inlineAddress", types = { Person.class }) <1>
+interface InlineAddress {
+
+ String getFirstName();
+
+ String getLastName();
+
+ Address getAddress(); <2>
+}
+```
+
+1. This projection has been named `inlineAddress`.
+1. This projection adds `getAddress`, which returns the `Address` field. When used inside a projection, it causes the information to be included inline.
+
+You can plug it into the `PersonRepository` definition, as follows:
+
+```java
+@RepositoryRestResource(excerptProjection = InlineAddress.class)
+interface PersonRepository extends CrudRepository {}
+```
+
+Doing so causes the HAL document to appear as follows:
+
+```javascript
+{
+ "firstName" : "Frodo",
+ "lastName" : "Baggins",
+ "address" : { <1>
+ "street": "Bag End",
+ "state": "The Shire",
+ "country": "Middle Earth"
+ },
+ "_links" : {
+ "self" : {
+ "href" : "http://localhost:8080/persons/1"
+ },
+ "address" : { <2>
+ "href" : "http://localhost:8080/persons/1/address"
+ }
+ }
+}
+```
+
+1. The `address` data is directly included inline, so you do not have to navigate to get it.
+1. The link to the `Address` resource is still provided, making it still possible to navigate to its own resource.
+
+Note that the preceding example is a mix of the examples shown earlier in this chapter. You may want to read back through them to follow the progression to the final example.
+
+> [!WARNING]
+> Configuring `@RepositoryRestResource(excerptProjection=…)` for a repository alters the default behavior. This can potentially cause breaking changes to consumers of your service if you have already made a release.
diff --git a/markdown/data-rest/5.0.0/repository-resources.md b/markdown/data-rest/5.0.0/repository-resources.md
new file mode 100644
index 000000000..c7ef8d4ab
--- /dev/null
+++ b/markdown/data-rest/5.0.0/repository-resources.md
@@ -0,0 +1,534 @@
+---
+title: "Repository resources"
+source: "ROOT:repository-resources.adoc"
+---
+
+
+
+# Repository resources
+
+
+
+## Fundamentals
+
+The core functionality of Spring Data REST is to export resources for Spring Data repositories. Thus, the core artifact to look at and potentially customize the way the exporting works is the repository interface. Consider the following repository interface:
+
+```
+public interface OrderRepository extends CrudRepository { }
+```
+
+For this repository, Spring Data REST exposes a collection resource at `/orders`. The path is derived from the uncapitalized, pluralized, simple class name of the domain class being managed. It also exposes an item resource for each of the items managed by the repository under the URI template `/orders/{id}`.
+
+By default, the HTTP methods to interact with these resources map to the according methods of `CrudRepository`. Read more on that in the sections on [collection resources](#repository-resources.collection-resource) and [item resources](#repository-resources.item-resource).
+
+
+
+### Repository methods exposure
+
+Which HTTP resources are exposed for a certain repository is mostly driven by the structure of the repository.
+In other words, the resource exposure will follow which methods you have exposed on the repository.
+If you extend `CrudRepository` you usually expose all methods required to expose all HTTP resources we can register by default.
+Each of the resources listed below will define which of the methods need to be present so that a particular HTTP method can be exposed for each of the resources.
+That means, that repositories that are not exposing those methods — either by not declaring them at all or explicitly using `@RestResource(exported = false)` — won’t expose those HTTP methods on those resources.
+
+For details on how to tweak the default method exposure or dedicated HTTP methods individually see [Customizing supported HTTP methods](customizing-sdr.md#customizing-sdr.http-methods).
+
+
+
+### Default Status Codes
+
+For the resources exposed, we use a set of default status codes:
+
+- `200 OK`: For plain `GET` requests.
+- `201 Created`: For `POST` and `PUT` requests that create new resources.
+- `204 No Content`: For `PUT`, `PATCH`, and `DELETE` requests when the configuration is set to not return response bodies for resource updates (`RepositoryRestConfiguration.setReturnBodyOnUpdate(…)`).
+If the configuration value is set to include responses for `PUT`, `200 OK` is returned for updates, and `201 Created` is returned for resource created through `PUT`.
+
+If the configuration values (`RepositoryRestConfiguration.returnBodyOnUpdate(…)` and `RepositoryRestConfiguration.returnBodyCreate(…)`) are explicitly set to `null` — which they are by default --, the presence of the HTTP Accept header is used to determine the response code.
+Read more on this in the detailed description of [collection](#repository-resources.collection-resource.supported-methods.post) and [item resources](#repository-resources.item-resource.supported-methods.put).
+
+
+
+### Resource Discoverability
+
+A core principle of [HATEOAS](https://github.com/spring-guides/understanding/tree/master/hateoas) is that resources should be discoverable through the publication of links that point to the available resources. There are a few competing de-facto standards of how to represent links in JSON. By default, Spring Data REST uses [HAL](https://tools.ietf.org/html/draft-kelly-json-hal) to render responses. HAL defines the links to be contained in a property of the returned document.
+
+Resource discovery starts at the top level of the application. By issuing a request to the root URL under which the Spring Data REST application is deployed, the client can extract, from the returned JSON object, a set of links that represent the next level of resources that are available to the client.
+
+For example, to discover what resources are available at the root of the application, issue an HTTP `GET` to the root URL, as follows:
+
+```
+curl -v http://localhost:8080/
+
+< HTTP/1.1 200 OK
+< Content-Type: application/hal+json
+
+{ "_links" : {
+ "orders" : {
+ "href" : "http://localhost:8080/orders"
+ },
+ "profile" : {
+ "href" : "http://localhost:8080/api/alps"
+ }
+ }
+}
+```
+
+The property of the result document is an object that consists of keys representing the relation type, with nested link objects as specified in HAL.
+
+> [!NOTE]
+> For more details about the `profile` link, see [Application-Level Profile Semantics (ALPS)](metadata.md#metadata.alps).
+
+
+
+## The Collection Resource
+
+Spring Data REST exposes a collection resource named after the uncapitalized, pluralized version of the domain class the exported repository is handling. Both the name of the resource and the path can be customized by using `@RepositoryRestResource` on the repository interface.
+
+
+
+### Supported HTTP Methods
+
+Collections resources support both `GET` and `POST`. All other HTTP methods cause a `405 Method Not Allowed`.
+
+
+
+#### `GET`
+
+Returns all entities the repository servers through its `findAll(…)` method.
+If the repository is a paging repository we include the pagination links if necessary and additional page metadata.
+
+
+
+##### Methods used for invocation
+
+The following methods are used if present (descending order):
+
+- `findAll(Pageable)`
+- `findAll(Sort)`
+- `findAll()`
+
+For more information on the default exposure of methods, see [Repository methods exposure](#repository-resources.methods).
+
+
+
+##### Parameters
+
+If the repository has pagination capabilities, the resource takes the following parameters:
+
+- `page`: The page number to access (0 indexed, defaults to 0).
+- `size`: The page size requested (defaults to 20).
+- `sort`: A collection of sort directives in the format `($propertyname,)+[asc|desc]`?.
+
+
+
+##### Custom Status Codes
+
+The `GET` method has only one custom status code:
+
+- `405 Method Not Allowed`: If the `findAll(…)` methods were not exported (through `@RestResource(exported = false)`) or are not present in the repository.
+
+
+
+##### Supported Media Types
+
+The `GET` method supports the following media types:
+
+- `application/hal+json`
+- `application/json`
+
+
+
+##### Related Resources
+
+The `GET` method supports a single link for discovering related resources:
+
+- `search`: A [search resource](#repository-resources.search-resource) is exposed if the backing repository exposes query methods.
+
+
+
+#### `HEAD`
+
+The `HEAD` method returns whether the collection resource is available. It has no status codes, media types, or related resources.
+
+
+
+##### Methods used for invocation
+
+The following methods are used if present (descending order):
+
+- `findAll(Pageable)`
+- `findAll(Sort)`
+- `findAll()`
+
+For more information on the default exposure of methods, see [Repository methods exposure](#repository-resources.methods).
+
+
+
+#### `POST`
+
+The `POST` method creates a new entity from the given request body.
+By default, whether the response contains a body is controlled by the `Accept` header sent with the request.
+If one is sent, a response body is created.
+If not, the response body is empty and a representation of the resource created can be obtained by following link contained in the `Location` response header.
+This behavior can be overridden by configuring `RepositoryRestConfiguration.setReturnBodyOnCreate(…)` accordingly.
+
+
+
+##### Methods used for invocation
+
+The following methods are used if present (descending order):
+
+- `save(…)`
+
+For more information on the default exposure of methods, see [Repository methods exposure](#repository-resources.methods).
+
+
+
+##### Custom Status Codes
+
+The `POST` method has only one custom status code:
+
+- `405 Method Not Allowed`: If the `save(…)` methods were not exported (through `@RestResource(exported = false)`) or are not present in the repository at all.
+
+
+
+##### Supported Media Types
+
+The `POST` method supports the following media types:
+
+- application/hal+json
+- application/json
+
+
+
+## The Item Resource
+
+Spring Data REST exposes a resource for individual collection items as sub-resources of the collection resource.
+
+
+
+### Supported HTTP Methods
+
+Item resources generally support `GET`, `PUT`, `PATCH`, and `DELETE`, unless explicit configuration prevents that (see “[The Association Resource](#repository-resources.association-resource)” for details).
+
+
+
+#### GET
+
+The `GET` method returns a single entity.
+
+
+
+##### Methods used for invocation
+
+The following methods are used if present (descending order):
+
+- `findById(…)`
+
+For more information on the default exposure of methods, see [Repository methods exposure](#repository-resources.methods).
+
+
+
+##### Custom Status Codes
+
+The `GET` method has only one custom status code:
+
+- `405 Method Not Allowed`: If the `findOne(…)` methods were not exported (through `@RestResource(exported = false)`) or are not present in the repository.
+
+
+
+##### Supported Media Types
+
+The `GET` method supports the following media types:
+
+- application/hal+json
+- application/json
+
+
+
+##### Related Resources
+
+For every association of the domain type, we expose links named after the association property. You can customize this behavior by using `@RestResource` on the property. The related resources are of the [association resource](#repository-resources.association-resource) type.
+
+
+
+#### `HEAD`
+
+The `HEAD` method returns whether the item resource is available. It has no status codes, media types, or related resources.
+
+
+
+##### Methods used for invocation
+
+The following methods are used if present (descending order):
+
+- `findById(…)`
+
+For more information on the default exposure of methods, see [Repository methods exposure](#repository-resources.methods).
+
+
+
+#### `PUT`
+
+The `PUT` method replaces the state of the target resource with the supplied request body.
+By default, whether the response contains a body is controlled by the `Accept` header sent with the request.
+If the request header is present, a response body and a status code of `200 OK` is returned.
+If no header is present, the response body is empty and a successful request returns a status of `204 No Content`.
+This behavior can be overridden by configuring `RepositoryRestConfiguration.setReturnBodyOnUpdate(…)` accordingly.
+
+
+
+##### Methods used for invocation
+
+The following methods are used if present (descending order):
+
+- `save(…)`
+
+For more information on the default exposure of methods, see [Repository methods exposure](#repository-resources.methods).
+
+
+
+##### Custom Status Codes
+
+The `PUT` method has only one custom status code:
+
+- `405 Method Not Allowed`: If the `save(…)` methods were not exported (through `@RestResource(exported = false)`) or is not present in the repository at all.
+
+
+
+##### Supported Media Types
+
+The `PUT` method supports the following media types:
+
+- application/hal+json
+- application/json
+
+
+
+#### `PATCH`
+
+The `PATCH` method is similar to the `PUT` method but partially updates the resources state.
+
+
+
+##### Methods used for invocation
+
+The following methods are used if present (descending order):
+
+- `save(…)`
+
+For more information on the default exposure of methods, see [Repository methods exposure](#repository-resources.methods).
+
+
+
+##### Custom Status Codes
+
+The `PATCH` method has only one custom status code:
+
+- `405 Method Not Allowed`: If the `save(…)` methods were not exported (through `@RestResource(exported = false)`) or are not present in the repository.
+
+
+
+##### Supported Media Types
+
+The `PATCH` method supports the following media types:
+
+- application/hal+json
+- application/json
+- [application/patch+json](https://tools.ietf.org/html/rfc6902)
+- [application/merge-patch+json](https://tools.ietf.org/html/rfc7386)
+
+
+
+#### `DELETE`
+
+The `DELETE` method deletes the resource exposed.
+By default, whether the response contains a body is controlled by the `Accept` header sent with the request.
+If the request header is present, a response body and a status code of `200 OK` is returned.
+If no header is present, the response body is empty and a successful request returns a status of `204 No Content`.
+This behavior can be overridden by configuring `RepositoryRestConfiguration.setReturnBodyOnDelete(…)` accordingly.
+
+
+
+##### Methods used for invocation
+
+The following methods are used if present (descending order):
+
+- `delete(T)`
+- `delete(ID)`
+- `delete(Iterable)`
+
+For more information on the default exposure of methods, see [Repository methods exposure](#repository-resources.methods).
+
+
+
+##### Custom Status Codes
+
+The `DELETE` method has only one custom status code:
+
+- `405 Method Not Allowed`: If the `delete(…)` methods were not exported (through `@RestResource(exported = false)`) or are not present in the repository.
+
+
+
+## The Association Resource
+
+Spring Data REST exposes sub-resources of every item resource for each of the associations the item resource has. The name and path of the resource defaults to the name of the association property and can be customized by using `@RestResource` on the association property.
+
+
+
+### Supported HTTP Methods
+
+The association resource supports the following media types:
+
+- GET
+- PUT
+- POST
+- DELETE
+
+
+
+#### `GET`
+
+The `GET` method returns the state of the association resource.
+
+
+
+##### Supported Media Types
+
+The `GET` method supports the following media types:
+
+- application/hal+json
+- application/json
+
+
+
+#### `PUT`
+
+The `PUT` method binds the resource pointed to by the given URI(s) to the association resource (see Supported Media Types).
+
+
+
+##### Custom Status Codes
+
+The `PUT` method has only one custom status code:
+
+- `400 Bad Request`: When multiple URIs were given for a to-one-association.
+
+
+
+##### Supported Media Types
+
+The `PUT` method supports only one media type:
+
+- text/uri-list: URIs pointing to the resource to bind to the association.
+
+
+
+#### `POST`
+
+The `POST` method is supported only for collection associations. It adds a new element to the collection.
+
+
+
+##### Supported Media Types
+
+The `POST` method supports only one media type:
+
+- text/uri-list: URIs pointing to the resource to add to the association.
+
+
+
+#### `DELETE`
+
+The `DELETE` method unbinds the association.
+
+
+
+##### Custom Status Codes
+
+The `POST` method has only one custom status code:
+
+- `405 Method Not Allowed`: When the association is non-optional.
+
+
+
+## The Search Resource
+
+The search resource returns links for all query methods exposed by a repository. The path and name of the query method resources can be modified using `@RestResource` on the method declaration.
+
+
+
+### Supported HTTP Methods
+
+As the search resource is a read-only resource, it supports only the `GET` method.
+
+
+
+#### `GET`
+
+The `GET` method returns a list of links pointing to the individual query method resources.
+
+
+
+##### Supported Media Types
+
+The `GET` method supports the following media types:
+
+- application/hal+json
+- application/json
+
+
+
+##### Related Resources
+
+For every query method declared in the repository, we expose a [query method resource](#repository-resources.query-method-resource). If the resource supports pagination, the URI pointing to it is a URI template containing the pagination parameters.
+
+
+
+#### `HEAD`
+
+The `HEAD` method returns whether the search resource is available. A 404 return code indicates no query method resources are available.
+
+
+
+## The Query Method Resource
+
+The query method resource runs the exposed query through an individual query method on the repository interface.
+
+
+
+### Supported HTTP Methods
+
+As the query method resource is a read-only resource, it supports `GET` only.
+
+
+
+#### `GET`
+
+The `GET` method returns the result of the query.
+
+
+
+##### Parameters
+
+If the query method has pagination capabilities (indicated in the URI template pointing to the resource) the resource takes the following parameters:
+
+- `page`: The page number to access (0 indexed, defaults to 0).
+- `size`: The page size requested (defaults to 20).
+- `sort`: A collection of sort directives in the format `($propertyname,)+[asc|desc]`?.
+
+
+
+##### Supported Media Types
+
+The `GET` method supports the following media types:
+
+- `application/hal+json`
+- `application/json`
+
+
+
+#### `HEAD`
+
+The `HEAD` method returns whether a query method resource is available.
diff --git a/markdown/data-rest/5.0.0/representations.md b/markdown/data-rest/5.0.0/representations.md
new file mode 100644
index 000000000..aab16dc67
--- /dev/null
+++ b/markdown/data-rest/5.0.0/representations.md
@@ -0,0 +1,80 @@
+---
+title: "Domain Object Representations (Object Mapping)"
+source: "ROOT:representations.adoc"
+---
+
+
+
+# Domain Object Representations (Object Mapping)
+
+Spring Data REST returns a representation of a domain object that corresponds to the `Accept` type specified in the HTTP request.
+
+Currently, only JSON representations are supported. Other representation types can be supported in the future by adding an appropriate converter and updating the controller methods with the appropriate content-type.
+
+Sometimes, the behavior of the Spring Data REST `ObjectMapper` (which has been specially configured to use intelligent serializers that can turn domain objects into links and back again) may not handle your domain model correctly. There are so many ways you can structure your data that you may find your own domain model is not translated to JSON correctly. It is also sometimes not practical in these cases to try and support a complex domain model in a generic way. Sometimes, depending on the complexity, it is not even possible to offer a generic solution.
+
+
+
+## Adding Custom Serializers and Deserializers to Jackson’s ObjectMapper
+
+To accommodate the largest percentage of use cases, Spring Data REST tries very hard to render your object graph correctly. It tries to serialize unmanaged beans as normal POJOs, and it tries to create links to managed beans where necessary. However, if your domain model does not easily lend itself to reading or writing plain JSON, you may want to configure Jackson’s ObjectMapper with your own custom mappings, serializers, and deserializers.
+
+
+
+### Abstract Class Registration
+
+One key configuration point you might need to hook into is when you use an abstract class (or an interface) in your domain model. By default, Jackson does not know what implementation to create for an interface. Consider the following example:
+
+```java
+@Entity
+public class MyEntity {
+ @OneToMany
+ private List interfaces;
+}
+```
+
+In a default configuration, Jackson has no idea what class to instantiate when POSTing new data to the exporter. This is something you need to tell Jackson either through an annotation, or (more cleanly) by registering a type mapping by using a `Module`.
+
+To add your own Jackson configuration to the `ObjectMapper` used by Spring Data REST, override the `configureJacksonObjectMapper` method.
+That method is passed an `MapperBuilder` instance that has a special module to handle serializing and deserializing `PersistentEntity` objects.
+You can register your own modules as well, as the following example shows:
+
+```java
+@Override
+public void configureJacksonObjectMapper(MapperBuilder extends ObjectMapper, ? extends MapperBuilder, ?>> mapperBuilder) {
+
+ mapperBuilder.addModule(new SimpleModule("MyCustomModule") {
+
+ @Override
+ public void setupModule(SetupContext context) {
+ context.addAbstractTypeResolver(
+ new SimpleAbstractTypeResolver()
+ .addMapping(MyInterface.class, MyInterfaceImpl.class));
+ }
+ });
+}
+```
+
+Once you have access to the `SetupContext` object in your `Module`, you can do all sorts of cool things to configure Jackson’s JSON mapping.
+You can read more about how `Module` instances work on [Jackson’s wiki](https://github.com/FasterXML/jackson-databind/wiki/JacksonFeatures).
+
+
+
+### Adding Custom Serializers for Domain Types
+
+If you want to serialize or deserialize a domain type in a special way, you can register your own implementations with Jackson’s `ObjectMapper`, and the Spring Data REST exporter transparently handles those domain objects correctly. To add serializers from your `setupModule` method implementation, you can do something like the following:
+
+```java
+@Override
+public void setupModule(SetupContext context) {
+
+ SimpleSerializers serializers = new SimpleSerializers();
+ SimpleDeserializers deserializers = new SimpleDeserializers();
+
+ serializers.addSerializer(MyEntity.class, new MyEntitySerializer());
+ deserializers.addDeserializer(MyEntity.class, new MyEntityDeserializer());
+
+ context.addSerializers(serializers);
+ context.addDeserializers(deserializers);
+}
+```
diff --git a/markdown/data-rest/5.0.0/security.md b/markdown/data-rest/5.0.0/security.md
new file mode 100644
index 000000000..906d41587
--- /dev/null
+++ b/markdown/data-rest/5.0.0/security.md
@@ -0,0 +1,108 @@
+---
+title: "Security"
+source: "ROOT:security.adoc"
+---
+
+
+
+# Security
+
+Spring Data REST works quite well with Spring Security. This section shows examples of how to secure your Spring Data REST services with method-level security.
+
+
+
+## `@Pre` and `@Post` Security
+
+The following example from Spring Data REST’s test suite shows Spring Security’s [PreAuthorization model](https://docs.spring.io/spring-security/reference/servlet/authorization/expression-based.html#_access_control_using_preauthorize_and_postauthorize) (the most sophisticated security model):
+
+```java
+@PreAuthorize("hasRole('ROLE_USER')") // <1>
+public interface PreAuthorizedOrderRepository extends CrudRepository {
+
+ @PreAuthorize("hasRole('ROLE_ADMIN')")
+ @Override
+ Optional findById(UUID id);
+
+ @PreAuthorize("hasRole('ROLE_ADMIN')") // <2>
+ @Override
+ void deleteById(UUID aLong);
+
+ @PreAuthorize("hasRole('ROLE_ADMIN')")
+ @Override
+ void delete(Order order);
+
+ @PreAuthorize("hasRole('ROLE_ADMIN')")
+ @Override
+ void deleteAll(Iterable extends Order> orders);
+
+ @PreAuthorize("hasRole('ROLE_ADMIN')")
+ @Override
+ void deleteAll();
+}
+```
+
+1. This Spring Security annotation secures the entire repository. The [Spring Security SpEL expression](https://docs.spring.io/spring-security/reference/servlet/authorization/expression-based.html) indicates that the principal must have `ROLE_USER` in its collection of roles.
+1. To change method-level settings, you must override the method signature and apply a Spring Security annotation. In this case, the method overrides the repository-level settings with the requirement that the user have `ROLE_ADMIN` to perform a delete.
+
+The preceding example shows a standard Spring Data repository definition extending `CrudRepository` with some key changes: the specification of particular roles to access the various methods:
+
+> [!IMPORTANT]
+> Repository and method level security settings do not combine. Instead, method-level settings override repository level settings.
+
+The previous example illustrates that `CrudRepository`, in fact, has four delete methods. You must override all delete methods to properly secure it.
+
+
+
+## @Secured security
+
+The following example shows Spring Security’s older `@Secured` annotation, which is purely role-based:
+
+```java
+@Secured("ROLE_USER") // <1>
+@RepositoryRestResource(collectionResourceRel = "people", path = "people")
+public interface SecuredPersonRepository extends CrudRepository {
+
+ @Secured("ROLE_ADMIN") // <2>
+ @Override
+ void deleteById(UUID aLong);
+
+ @Secured("ROLE_ADMIN")
+ @Override
+ void delete(Person person);
+
+ @Secured("ROLE_ADMIN")
+ @Override
+ void deleteAll(Iterable extends Person> persons);
+
+ @Secured("ROLE_ADMIN")
+ @Override
+ void deleteAll();
+}
+```
+
+1. This results in the same security check as the previous example but has less flexibility. It allows only roles as the means to restrict access.
+1. Again, this shows that delete methods require `ROLE_ADMIN`.
+
+> [!NOTE]
+> If you start with a new project or first apply Spring Security, `@PreAuthorize` is the recommended solution. If are already using Spring Security with `@Secured` in other parts of your app, you can continue on that path without rewriting everything.
+
+
+
+## Enabling Method-level Security
+
+To configure method-level security, here is a brief snippet from Spring Data REST’s test suite:
+
+```java
+@Configuration // <1>
+@EnableWebSecurity
+@EnableMethodSecurity(securedEnabled = true, prePostEnabled = true) // <2>
+class SecurityConfiguration { // <3>
+ ...
+}
+```
+
+1. This is a Spring configuration class.
+1. It uses Spring Security’s `@EnableGlobalMethodSecurity` annotation to enable both `@Secured` and `@Pre`/`@Post` support. NOTE: You don’t have to use both. This particular case is used to prove both versions work with Spring Data REST.
+1. This class extends Spring Security’s `WebSecurityConfigurerAdapter` which is used for pure Java configuration of security.
+
+The rest of the configuration class is not listed, because it follows [standard practices](https://docs.spring.io/spring-security/reference/servlet/configuration/java.html) that you can read about in the Spring Security reference docs.
diff --git a/markdown/data-rest/5.0.0/tools.md b/markdown/data-rest/5.0.0/tools.md
new file mode 100644
index 000000000..4ab0a831b
--- /dev/null
+++ b/markdown/data-rest/5.0.0/tools.md
@@ -0,0 +1,58 @@
+---
+title: "Tools"
+source: "ROOT:tools.adoc"
+---
+
+
+
+# Tools
+
+
+
+## The HAL Explorer
+
+Kai Tödter has created a useful application: HAL Explorer ([Git Repo](https://github.com/toedter/hal-explorer), [Reference Doc](https://toedter.github.io/hal-explorer/release/reference-doc/), [Demo](https://toedter.github.io/hal-explorer/release/hal-explorer/#theme=Cosmo&uri=examples/examples.hal-forms.json)). It is an Angular based web application that lets you easily explore HAL and HAL-FORMS based HTTP responses. It also supports Spring profiles generated by Spring Data REST. You can point it at any Spring Data REST API and use it to navigate the app and create new resources.
+
+Instead of pulling down the files, embedding them in your application, and crafting a Spring MVC controller to serve them up, all you need to do is add a single dependency.
+
+The following listing shows how to add the dependency in Maven:
+
+```xml
+
+
+ org.springframework.data
+ spring-data-rest-hal-explorer
+
+
+```
+
+The following listing shows how to add the dependency in Gradle:
+
+```groovy
+dependencies {
+ implementation 'org.springframework.data:spring-data-rest-hal-explorer'
+}
+```
+
+> [!NOTE]
+> If you use Spring Boot or the Spring Data BOM (bill of materials), you do not need to specify the version.
+
+This dependency auto-configures the HAL Explorer to be served up when you visit your application’s root URI in a browser. (NOTE: [localhost:8080/api](http://localhost:8080/api) was plugged into the browser, and it redirected to the URL shown in the following image.)
+
+
+
+The preceding screenshot shows the root path of the API. On the right side are details from the response, including headers, and the body (a HAL document).
+
+The HAL Explorer reads the links from the response and puts them in a list on the left side. You can either click on the green **GET** button and navigate to one of the collections, or click on the other buttons to make changes (POST, PUT, PATCH) or delete resources.
+
+The HAL Explorer understands **URI Templates**. Whenever a link contains a URI template, a modal dialog pops up where you can enter the template parameters.
+
+
+
+If you click **Go!** without entering anything, the variables are essentially ignored. For situations like [Projections and Excerpts](projections-excerpts.md) or [Paging and Sorting](paging-and-sorting.md), this can be useful.
+
+When you click on a **NON-GET** button with a `+` or a `>` sign on it, a modal dialog appears. It shows the HTTP method belonging to the clicked button. You can fill the body and submit the new JSON document.
+
+Below the URI and HTTP method are the fields. These are automatically supplied, depending on the metadata of the resources, which was automatically generated by Spring Data REST. If you update your domain objects, the pop-up reflects it, as the following image shows:
+
+
diff --git a/markdown/data-rest/5.0.0/validation.md b/markdown/data-rest/5.0.0/validation.md
new file mode 100644
index 000000000..14a472cc4
--- /dev/null
+++ b/markdown/data-rest/5.0.0/validation.md
@@ -0,0 +1,25 @@
+---
+title: "Validation"
+source: "ROOT:validation.adoc"
+---
+
+
+
+# Validation
+
+There are two ways to register a `Validator` instance in Spring Data REST: wire it by bean name or register the validator manually. For the majority of cases, the simple bean name prefix style is sufficient.
+
+In order to tell Spring Data REST you want a particular `Validator` assigned to a particular event, prefix the bean name with the event in question. For example, to validate instances of the `Person` class before new ones are saved into the repository, you would declare an instance of a `Validator` in your `ApplicationContext` with a bean name of `beforeCreatePersonValidator`. Since the `beforeCreate` prefix matches a known Spring Data REST event, that validator is wired to the correct event.
+
+
+
+## Assigning Validators Manually
+
+If you would rather not use the bean name prefix approach, you need to register an instance of your validator with the bean whose job it is to invoke validators after the correct event. In your configuration that implements `RepositoryRestConfigurer`, override the `configureValidatingRepositoryEventListener` method and call `addValidator` on the `ValidatingRepositoryEventListener`, passing the event on which you want this validator to be triggered and an instance of the validator. The following example shows how to do so:
+
+```java
+@Override
+void configureValidatingRepositoryEventListener(ValidatingRepositoryEventListener v) {
+ v.addValidator("beforeSave", new BeforeSaveValidator());
+}
+```