Skip to content

Commit d1889d2

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

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 = EntityModel.of(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
@@ -12,7 +12,7 @@
1212
https://tools.ietf.org/html/draft-kelly-json-hal-08[JSON Hypertext Application Language] or HAL is one of the simplest
1313
and most widely adopted hypermedia media types adopted when not discussing specific web stacks.
1414

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

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

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

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

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

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

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

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

207207
As for single-item (`EntityModel`) and aggregate root collections (`CollectionModel`), Spring HATEOAS renders them
@@ -217,7 +217,7 @@ Spring HATEOAS allows to customize those by shaping the model type for the input
217217
|Attribute|Description
218218
|`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`.
219219
|`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.
220-
|`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.
220+
|`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.
221221
|===============
222222

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

246246
==== Template titles
247-
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.
247+
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.
248248
This means that you'll usually have to qualify the key with the local or fully qualified input type name that affordance describes.
249249

250250
.Defining HAL-FORMS template titles
@@ -276,7 +276,7 @@ firstName._prompt=Firstname <1>
276276
Employee.firstName._prompt=Firstname <2>
277277
com.acme.Employee.firstName._prompt=Firstname <3>
278278
----
279-
<1> All properties named `email` will get "Firstname" rendered, independent of the type they're declared in.
279+
<1> All properties named `firstName` will get "Firstname" rendered, independent of the type they're declared in.
280280
<2> The `firstName` property in types named `Employee` will be prompted "Firstname".
281281
<3> The `firstName` property of `com.acme.Employee` will get a prompt of "Firstname" assigned.
282282
====
@@ -394,7 +394,7 @@ The previous fragment was lifted from the spec. When Spring HATEOAS renders an `
394394
395395
* Put the `self` link into both the document's `href` attribute and the item-level `href` attribute.
396396
* Put the rest of the model's links into both the top-level `links` as well as the item-level `links`.
397-
* Extract the properties from the `EntityModel` and turn them into
397+
* Extract the properties from the `EntityModel` and turn them into ...
398398
====
399399

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

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

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

538538
[[mediatypes.custom.configuration]]
@@ -571,7 +571,7 @@ class MyMediaTypeConfigurationProvider
571571
The configuration class needs to have a default constructor and expose two methods:
572572
573573
<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`).
574-
<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.
574+
<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.
575575
====
576576

577577
The configuration class has to implement `HypermediaMappingInformation`. It could look as simple as this:
@@ -600,7 +600,7 @@ class MyMediaTypeConfiguration implements HypermediaMappingInformation {
600600
----
601601
<1> The configuration class returns the media type it wants to get Spring MVC / Spring WebFlux support set up.
602602
<2> It overrides `getJacksonModule()` to provide custom serializers to create the media type specific representations.
603-
<3> It also declares a custom `LinkDiscoverer` implementation for client side support.
603+
<3> It also declares a custom `LinkDiscoverer` implementation for client-side support.
604604
====
605605

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

612612
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.
613-
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.
613+
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.
614614

615-
The media types supported by default use the same configuration mechanism as third party implementations would.
615+
The media types supported by default use the same configuration mechanism as third-party implementations would do.
616616
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)