Skip to content

Commit

Permalink
Fix typos and annotation use in reference documentation.
Browse files Browse the repository at this point in the history
Closes #2370
  • Loading branch information
yejianfengblue authored and mp911de committed Mar 5, 2024
1 parent c735dfd commit 8d4cf6e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The following example shows how to use the `@RepositoryRestController` annotatio
====
[source,java]
----
@BasePathAwareController
@RepositoryRestController
class ScannerController {
private final ScannerRepository repository;
Expand Down Expand Up @@ -47,7 +47,7 @@ class ScannerController {

`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<EntityModel<String>>` (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/listProducers`.
IMPORTANT: In this example, the combined path is `RepositoryRestConfiguration.getBasePath()` + `/scanners/search/producers`.

[[customizing-sdr.aggregate-references]]
== Obtaining Aggregate References
Expand All @@ -60,7 +60,7 @@ All you need to do is declare an `@RequestParam` of that type and then consume e

[source,java]
----
@BasePathAwareController
@RepositoryRestController
class ScannerController {
private final ScannerRepository repository;
Expand Down Expand Up @@ -93,7 +93,7 @@ In case you are using jMolecules, `AssociationAggregateReference` also allows yo
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.

[[customizing-sdr.overriding-sdr-response-handlers.annotations]]
== `@RepositoryRestResource` VS. `@BasePathAwareController`
== `@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.
Expand Down

0 comments on commit 8d4cf6e

Please sign in to comment.