Skip to content

Wording changes in reference documentation #379

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/main/asciidoc/customizing-json-output.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ You can add links to the default representation of an entity by calling `resourc

== Customizing the Representation

The Spring Data REST exporter executes any discovered `ResourceProcessor` instances before it creates the output representation. It does so by registering a `Converter<Entity, Resource>` 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.
The Spring Data REST exporter runs any discovered `ResourceProcessor` instances before it creates the output representation. It does so by registering a `Converter<Entity, Resource>` 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<Entity, Resource>`, you can return a `Resource` implementation of your choosing.
2 changes: 1 addition & 1 deletion src/main/asciidoc/etags-and-other-conditionals.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ curl -v -H 'If-None-Match: <value of previous etag>' ...
----
====

The preceding command (by default) executes 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.`"
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.

Expand Down
2 changes: 1 addition & 1 deletion src/main/asciidoc/metadata.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ As shown in the <<metadata.alps,previous section>>, you can reach this data by n

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 executed `curl -H 'Accept:application/schema+json' http://localhost:8080/profile/persons`, you would see output resembling the following:
In this case, if you ran `curl -H 'Accept:application/schema+json' http://localhost:8080/profile/persons`, you would see output resembling the following:

====
[source,javascript]
Expand Down
2 changes: 1 addition & 1 deletion src/main/asciidoc/repository-resources.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ As the search resource is a read-only resource, it supports `GET` only.

==== `GET`

The `GET` method returns the result of the query execution.
The `GET` method returns the result of the query.

===== Parameters

Expand Down
2 changes: 1 addition & 1 deletion src/main/asciidoc/spring-data-rest-examples.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ https://github.com/spring-projects/spring-data-examples/tree/master/rest/securit
[[spring-data-examples.starbucks]]
== Starbucks example

https://github.com/spring-projects/spring-data-examples/tree/master/rest/starbucks[This example] 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 execute a geo-location search for coffee shops.
https://github.com/spring-projects/spring-data-examples/tree/master/rest/starbucks[This example] 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.