Skip to content

Commit d922d6f

Browse files
rolandkruegerodrotbohm
authored andcommitted
#1190 - Fix typos, document links, and grammatical errors.
Unfinished sentences were marked with ellipsis….
1 parent 09c1bae commit d922d6f

File tree

6 files changed

+39
-38
lines changed

6 files changed

+39
-38
lines changed

src/main/asciidoc/client.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Instead of fetching a single resource, this one deserializes a collection into `
7777

7878
When working with hypermedia enabled representations, a common task is to find a link with a particular relation type in it. Spring HATEOAS provides https://code.google.com/p/json-path[JSONPath]-based implementations of the `LinkDiscoverer` interface for either the default representation rendering or HAL out of the box. When using `@EnableHypermediaSupport`, we automatically expose an instance supporting the configured hypermedia type as a Spring bean.
7979

80-
Alternatively, you can setup and use an instance as follows:
80+
Alternatively, you can set up and use an instance as follows:
8181

8282
====
8383
[source, java]

src/main/asciidoc/configuration.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This section describes how to configure Spring HATEOAS.
66
[[configuration.at-enable]]
77
== Using `@EnableHypermediaSupport`
88

9-
To let the `RepresentationModel` subtypes be rendered according to the specification of various hypermedia representations types, you can activate support for a particular hypermedia representation format through `@EnableHypermediaSupport`. The annotation takes a `HypermediaType` enumeration as its argument. Currently, we support https://tools.ietf.org/html/draft-kelly-json-hal[HAL] as well as a default rendering. Using the annotation triggers the following:
9+
To let the `RepresentationModel` subtypes be rendered according to the specification of various hypermedia representation types, you can activate support for a particular hypermedia representation format through `@EnableHypermediaSupport`. The annotation takes a `HypermediaType` enumeration as its argument. Currently, we support https://tools.ietf.org/html/draft-kelly-json-hal[HAL] as well as a default rendering. Using the annotation triggers the following:
1010

1111
* It registers necessary Jackson modules to render `EntityModel` and `CollectionModel` in the hypermedia specific format.
1212
* If JSONPath is on the classpath, it automatically registers a `LinkDiscoverer` instance to look up links by their `rel` in plain JSON representations (see <<client.link-discoverer>>).
@@ -18,7 +18,7 @@ To let the `RepresentationModel` subtypes be rendered according to the specifica
1818

1919
By default, `@EnableHypermediaSupport` will reflectively detect the web application stack you're using and hook into the Spring components registered for those to enable support for hypermedia representations.
2020
However, there are situations in which you'd only explicitly want to activate support for a particular stack.
21-
E.g. if your Spring WebMVC based application uses WebFlux' `WebClient` to make outgoing requests and that one is not supposed to work with hypermedia elements, you can restrict the functionality to be enabled by explicitly declaring WebMvc in the configuration:
21+
E.g. if your Spring WebMVC based application uses WebFlux' `WebClient` to make outgoing requests and that one is not supposed to work with hypermedia elements, you can restrict the functionality to be enabled by explicitly declaring WebMVC in the configuration:
2222

2323
.Explicitly activating hypermedia support for a particular web stack
2424
====

src/main/asciidoc/fundamentals.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ include::{code-dir}/FundamentalsTest.java[tags=links]
4242
`Link` exposes other attributes as defined in https://tools.ietf.org/html/rfc5988[RFC-5988].
4343
You can set them by calling the corresponding wither method on a `Link` instance.
4444

45-
Find more information on how to create links pointing to Spring MVC and Spring WebFlux controllers in <<server.link-builder>>.
45+
Find more information on how to create links pointing to Spring MVC and Spring WebFlux controllers in <<server.link-builder.webmvc>> and <<server.link-builder.webflux>>.
4646

4747
[[fundamentals.uri-templates]]
4848
== URI templates
@@ -105,7 +105,7 @@ assertThat(IanaLinkRelation.isIanaRel(link.getRel())).isTrue();
105105
To easily create hypermedia enriched representations, Spring HATEOAS provides a set of classes with `RepresentationModel` at their root.
106106
It's basically a container for a collection of ``Link``s and has convenient methods to add those to the model.
107107
The models can later be rendered into various media type formats that will define how the hypermedia elements look in the representation.
108-
For more information on this, have a look at <<mediatypes>>
108+
For more information on this, have a look at <<mediatypes>>.
109109

110110
.The `RepresentationModel` class hierarchy
111111
====
@@ -187,7 +187,7 @@ EntityModel<Person> model = new EntityModel<>(person);
187187
For resources that are conceptually collections, a `CollectionModel` is available.
188188
Its elements can either be simple objects or `RepresentationModel` instances in turn.
189189

190-
.Using `EntityModel` to wrap existing objects
190+
.Using `CollectionModel` to wrap a collection of existing objects
191191
====
192192
[source, java]
193193
----

src/main/asciidoc/mediatypes.adoc

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
https://tools.ietf.org/html/draft-kelly-json-hal-08[JSON Hypertext Application Language] or HAL is one of the simplest
1212
and most widely adopted hypermedia media types adopted when not discussing specific web stacks.
1313

14-
It was the first spec-based media type adopted by Spring HATEAOS.
14+
It was the first spec-based media type adopted by Spring HATEOAS.
1515

1616
[[mediatypes.hal.configuration]]
1717
=== Configuring link rendering
@@ -30,7 +30,7 @@ include::{resource-dir}/docs/mediatype/hal/hal-multiple-entry-link-relation.json
3030
====
3131

3232
But if there is only one link for a given relation, the spec is ambiguous. You could render that as either a single object
33-
or as 1-item array.
33+
or as a single-item array.
3434

3535
By default, Spring HATEOAS uses the most terse approach and renders a single-link relation like this:
3636

@@ -77,7 +77,7 @@ include::{code-dir}/SampleAppConfiguration.java[tag=2]
7777
<2> Render `prev` link relations as an object when there is only one link.
7878
====
7979

80-
If neither of these match your needs, you can use an Ant-style path patterns:
80+
If neither of these match your needs, you can use an Ant-style path pattern:
8181

8282
.Pattern-based HAL single-link rendering policy
8383
====
@@ -200,7 +200,7 @@ include::{resource-dir}/docs/mediatype/hal/forms/hal-forms-sample.json[]
200200
----
201201
====
202202

203-
Checkout the https://rwcbook.github.io/hal-forms/[HAL-FORMS spec] to understand the details of the *_templates* attribute.
203+
Check out the https://rwcbook.github.io/hal-forms/[HAL-FORMS spec] to understand the details of the *_templates* attribute.
204204
Read about the <<server.affordances,Affordances API>> to augment your controllers with this extra metadata.
205205

206206
As for single-item (`EntityModel`) and aggregate root collections (`CollectionModel`), Spring HATEOAS renders them
@@ -216,7 +216,7 @@ Spring HATEOAS allows to customize those by shaping the model type for the input
216216
|Attribute|Description
217217
|`readOnly`| Set to `true` if there's no setter method for the property. If that is present, use Jackson's `@JsonProperty(Access.READ_ONLY)` on the accessors or field explicitly. Not rendered by default, thus defaulting to `false`.
218218
|`regex`| Can be customized by using JSR-303's `@Pattern` annotation either on the field or a type. In case of the latter the pattern will be used for every property declared as that particular type. Not rendered by default.
219-
|`required`| Can be customized by using JSR-303's `@NotNull`. Not rendered by default and thus defaulting to `false`. Templates using `PATCH` as method will automatically have set all properties to not required.
219+
|`required`| Can be customized by using JSR-303's `@NotNull`. Not rendered by default and thus defaulting to `false`. Templates using `PATCH` as method will automatically have all properties set to not required.
220220
|===============
221221

222222
For types that you cannot annotate manually, you can register a custom pattern via a `HalFormsConfiguration` bean present in the application context.
@@ -243,7 +243,7 @@ HAL-FORMS contains attributes that are intended for human interpretation, like a
243243
These can be defined and internationalized using Spring's resource bundle support and the `rest-messages` resource bundle configured by Spring HATEOAS by default.
244244

245245
==== Template titles
246-
To define a template title use the following pattern: `_templates.$affordanceName.title`. Note, that in HAL-FORMS, the name of a template is `default` if it is the only one.
246+
To define a template title use the following pattern: `_templates.$affordanceName.title`. Note that in HAL-FORMS, the name of a template is `default` if it is the only one.
247247
This means that you'll usually have to qualify the key with the local or fully qualified input type name that affordance describes.
248248

249249
.Defining HAL-FORMS template titles
@@ -275,7 +275,7 @@ firstName._prompt=Firstname <1>
275275
Employee.firstName._prompt=Firstname <2>
276276
com.acme.Employee.firstName._prompt=Firstname <3>
277277
----
278-
<1> All properties named `email` will get "Firstname" rendered, independent of the type they're declared in.
278+
<1> All properties named `firstName` will get "Firstname" rendered, independent of the type they're declared in.
279279
<2> The `firstName` property in types named `Employee` will be prompted "Firstname".
280280
<3> The `firstName` property of `com.acme.Employee` will get a prompt of "Firstname" assigned.
281281
====
@@ -358,7 +358,7 @@ The previous fragment was lifted from the spec. When Spring HATEOAS renders an `
358358
359359
* Put the `self` link into both the document's `href` attribute and the item-level `href` attribute.
360360
* Put the rest of the model's links into both the top-level `links` as well as the item-level `links`.
361-
* Extract the properties from the `EntityModel` and turn them into
361+
* Extract the properties from the `EntityModel` and turn them into ...
362362
====
363363

364364
When rendering a collection of resources, the document is almost the same, except there will be multiple entries inside
@@ -493,10 +493,10 @@ locale-specific message bundles and even internationalize the metadata.
493493
== Registering a custom media type
494494

495495
Spring HATEOAS allows to integrate support for custom media types through a set of SPIs, that third parties can implement.
496-
The building blocks of an such an implementations are:
496+
The building blocks of an such an implementation are:
497497

498498
1. Some form of Jackson ObjectMapper customization. In its most simple case that's a Jackson `Module` implementation.
499-
2. A `LinkDiscoverer` implementation so that the client side support is able to detect links in representations generated.
499+
2. A `LinkDiscoverer` implementation so that the client-side support is able to detect links in representations generated.
500500
3. Some configuration infrastructure that will allow Spring HATEOAS to find the custom implementation and pick up its configuration.
501501

502502
[[mediatypes.custom.configuration]]
@@ -535,7 +535,7 @@ class MyMediaTypeConfigurationProvider
535535
The configuration class needs to have a default constructor and expose two methods:
536536
537537
<1> A method returning a Spring configuration class that will be included in the application bootstrap when Spring HATEOAS is activated (either implicitly via Spring Boot auto-configuration or via `@EnableHypermediaSupport`).
538-
<2> A callback method that will get the application selected media types to activate passed. This allows the media type implementation to control, when it it will be activated.
538+
<2> A callback method that will get passed the application selected media types to activate. This allows the media type implementation to control, when it will be activated.
539539
====
540540

541541
The configuration class has to implement `HypermediaMappingInformation`. It could look as simple as this:
@@ -564,7 +564,7 @@ class MyMediaTypeConfiguration implements HypermediaMappingInformation {
564564
----
565565
<1> The configuration class returns the media type it wants to get Spring MVC / Spring WebFlux support set up.
566566
<2> It overrides `getJacksonModule()` to provide custom serializers to create the media type specific representations.
567-
<3> It also declares a custom `LinkDiscoverer` implementation for client side support.
567+
<3> It also declares a custom `LinkDiscoverer` implementation for client-side support.
568568
====
569569

570570
The Jackson module usually declares `Serializer` and `Deserializer` implementations for the representation model types `RepresentationModel`, `EntityModel`, `CollectionModel` and `PagedModel`.
@@ -574,7 +574,7 @@ In case you need further customization of the Jackson `ObjectMapper` (like a cus
574574
=== Recommendations
575575

576576
The preferred way to implement media type representations is by providing a type hierarchy that matches the expected format and can be serialized by Jackson as is.
577-
In the `Serializer` and `Deserializer` implementations registered for `RepresentationModel`, convert the instances into the media type specific model types and then lookup the Jackson serializer for those.
577+
In the `Serializer` and `Deserializer` implementations registered for `RepresentationModel`, convert the instances into the media type-specific model types and then lookup the Jackson serializer for those.
578578

579-
The media types supported by default use the same configuration mechanism as third party implementations would.
579+
The media types supported by default use the same configuration mechanism as third-party implementations would do.
580580
So it's worth studying the implementations in https://github.com/spring-projects/spring-hateoas/tree/master/src/main/java/org/springframework/hateoas/mediatype[the `mediatype` package].

src/main/asciidoc/migrate-to-1.0.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Also the name changes have been reflected in the classes contained in `TypeRefer
3333
* The `LinkDiscoverer` API has been moved to the `client` package.
3434
* The `LinkBuilder` and `EntityLinks` APIs have been moved to the `server` package.
3535
* `ControllerLinkBuilder` has been moved into `server.mvc` and deprecated to be replaced by `WebMvcLinkBuilder`.
36-
* `RelProvider` has been renamed to `LinkRelationProvider` and returns `LinkRelation` instances instead of `String`s.
36+
* `RelProvider` has been renamed to `LinkRelationProvider` and returns `LinkRelation` instances instead of ``String``s.
3737
* `VndError` has been moved to the `mediatype.vnderror` package.
3838

3939
[[migrate-to-1.0.script]]

0 commit comments

Comments
 (0)