Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos and annotation use in reference documentation #2370

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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