diff --git a/src/main/asciidoc/fundamentals.adoc b/src/main/asciidoc/fundamentals.adoc index f68a8d2e..6a9872b7 100644 --- a/src/main/asciidoc/fundamentals.adoc +++ b/src/main/asciidoc/fundamentals.adoc @@ -39,7 +39,7 @@ include::{code-dir}/FundamentalsTest.java[tags=links] ---- ==== -`Link` exposes other attributes as defined in https://tools.ietf.org/html/rfc5988[RFC-5988]. +`Link` exposes other attributes as defined in https://tools.ietf.org/html/rfc8288[RFC-8288]. You can set them by calling the corresponding wither method on a `Link` instance. Find more information on how to create links pointing to Spring MVC and Spring WebFlux controllers in <> and <>. diff --git a/src/main/asciidoc/mediatypes.adoc b/src/main/asciidoc/mediatypes.adoc index 862c6e35..e9907719 100644 --- a/src/main/asciidoc/mediatypes.adoc +++ b/src/main/asciidoc/mediatypes.adoc @@ -136,7 +136,7 @@ This will result in the following HAL representation: [[mediatypes.hal.curie-provider]] === [[spis.curie-provider]] Using the `CurieProvider` API -The https://tools.ietf.org/html/rfc5988=section-4[Web Linking RFC] describes registered and extension link relation types. Registered rels are well-known strings registered with the https://www.iana.org/assignments/link-relations/link-relations.xhtml[IANA registry of link relation types]. Extension `rel` URIs can be used by applications that do not wish to register a relation type. Each one is a URI that uniquely identifies the relation type. The `rel` URI can be serialized as a compact URI or https://www.w3.org/TR/curie[Curie]. For example, a curie of `ex:persons` stands for the link relation type `https://example.com/rels/persons` if `ex` is defined as `https://example.com/rels/{rel}`. If curies are used, the base URI must be present in the response scope. +The https://tools.ietf.org/html/rfc8288#section-2.1[Web Linking RFC] describes registered and extension link relation types. Registered rels are well-known strings registered with the https://www.iana.org/assignments/link-relations/link-relations.xhtml[IANA registry of link relation types]. Extension `rel` URIs can be used by applications that do not wish to register a relation type. Each one is a URI that uniquely identifies the relation type. The `rel` URI can be serialized as a compact URI or https://www.w3.org/TR/curie[Curie]. For example, a curie of `ex:persons` stands for the link relation type `https://example.com/rels/persons` if `ex` is defined as `https://example.com/rels/{rel}`. If curies are used, the base URI must be present in the response scope. The `rel` values created by the default `RelProvider` are extension relation types and, as a result, must be URIs, which can cause a lot of overhead. The `CurieProvider` API takes care of that: It lets you define a base URI as a URI template and a prefix that stands for that base URI. If a `CurieProvider` is present, the `RelProvider` prepends all `rel` values with the curie prefix. Furthermore a `curies` link is automatically added to the HAL resource. diff --git a/src/main/java/org/springframework/hateoas/Link.java b/src/main/java/org/springframework/hateoas/Link.java index 726ca736..8031ef31 100755 --- a/src/main/java/org/springframework/hateoas/Link.java +++ b/src/main/java/org/springframework/hateoas/Link.java @@ -462,18 +462,18 @@ public class Link implements Serializable { } /** - * Factory method to easily create {@link Link} instances from RFC-5988 compatible {@link String} representations of a + * Factory method to easily create {@link Link} instances from RFC-8288 compatible {@link String} representations of a * link. * - * @param element an RFC-5899 compatible representation of a link. - * @throws IllegalArgumentException if a {@link String} was given that does not adhere to RFC-5899. + * @param element an RFC-8288 compatible representation of a link. + * @throws IllegalArgumentException if a {@link String} was given that does not adhere to RFC-8288. * @throws IllegalArgumentException if no {@code rel} attribute could be found. * @return */ public static Link valueOf(String element) { if (!StringUtils.hasText(element)) { - throw new IllegalArgumentException(String.format("Given link header %s is not RFC5988 compliant!", element)); + throw new IllegalArgumentException(String.format("Given link header %s is not RFC-8288 compliant!", element)); } Matcher matcher = URI_AND_ATTRIBUTES_PATTERN.matcher(element); @@ -519,7 +519,7 @@ public class Link implements Serializable { return link; } else { - throw new IllegalArgumentException(String.format("Given link header %s is not RFC5988 compliant!", element)); + throw new IllegalArgumentException(String.format("Given link header %s is not RFC-8288 compliant!", element)); } } diff --git a/src/main/java/org/springframework/hateoas/Links.java b/src/main/java/org/springframework/hateoas/Links.java index 6990771c..f8ec9164 100644 --- a/src/main/java/org/springframework/hateoas/Links.java +++ b/src/main/java/org/springframework/hateoas/Links.java @@ -79,7 +79,7 @@ public class Links implements Iterable { } /** - * Creates a {@link Links} instance from the given RFC5988-compatible link format. + * Creates a {@link Links} instance from the given RFC-8288-compatible link format. * * @param source a comma separated list of {@link Link} representations. * @return the {@link Links} represented by the given {@link String}. @@ -91,7 +91,7 @@ public class Links implements Iterable { } /** - * Creates a {@link Links} instance from the given RFC5988-compatible link format. + * Creates a {@link Links} instance from the given RFC-8288-compatible link format. * * @param source a comma separated list of {@link Link} representations. * @return the {@link Links} represented by the given {@link String}. diff --git a/src/test/java/org/springframework/hateoas/LinkUnitTest.java b/src/test/java/org/springframework/hateoas/LinkUnitTest.java index 0c40784d..337cea03 100755 --- a/src/test/java/org/springframework/hateoas/LinkUnitTest.java +++ b/src/test/java/org/springframework/hateoas/LinkUnitTest.java @@ -125,7 +125,7 @@ class LinkUnitTest { * @see #678 */ @Test - void parsesRFC5988HeaderIntoLink() { + void parsesRFC8288HeaderIntoLink() { assertSoftly(softly -> { @@ -184,7 +184,7 @@ class LinkUnitTest { } @Test - void rejectsNonRFC5988String() { + void rejectsNonRFC8288String() { assertThatIllegalArgumentException().isThrownBy(() -> { Link.valueOf("foo"); diff --git a/src/test/java/org/springframework/hateoas/LinksUnitTest.java b/src/test/java/org/springframework/hateoas/LinksUnitTest.java index b466391e..11014fad 100755 --- a/src/test/java/org/springframework/hateoas/LinksUnitTest.java +++ b/src/test/java/org/springframework/hateoas/LinksUnitTest.java @@ -96,7 +96,7 @@ class LinksUnitTest { } /** - * @see https://tools.ietf.org/html/rfc5988#section-5.5 + * @see https://tools.ietf.org/html/rfc8288#section-3.5 */ @Test void parsesLinksWithWhitespace() { diff --git a/src/test/java/org/springframework/hateoas/mediatype/hal/DefaultCurieProviderUnitTest.java b/src/test/java/org/springframework/hateoas/mediatype/hal/DefaultCurieProviderUnitTest.java index 61edcc6a..3973e2c6 100755 --- a/src/test/java/org/springframework/hateoas/mediatype/hal/DefaultCurieProviderUnitTest.java +++ b/src/test/java/org/springframework/hateoas/mediatype/hal/DefaultCurieProviderUnitTest.java @@ -111,7 +111,7 @@ class DefaultCurieProviderUnitTest { * @see #100 */ @Test - void prefixesNormalRelsThatHaveExtraRFC5988Attributes() { + void prefixesNormalRelsThatHaveExtraRFC8288Attributes() { Link link = Link.of("https://amazon.com", "custom:rel") // .withHreflang("en") // diff --git a/src/test/java/org/springframework/hateoas/mediatype/hal/Jackson2HalIntegrationTest.java b/src/test/java/org/springframework/hateoas/mediatype/hal/Jackson2HalIntegrationTest.java index 6e9d43ba..15f7e8bb 100755 --- a/src/test/java/org/springframework/hateoas/mediatype/hal/Jackson2HalIntegrationTest.java +++ b/src/test/java/org/springframework/hateoas/mediatype/hal/Jackson2HalIntegrationTest.java @@ -122,7 +122,7 @@ class Jackson2HalIntegrationTest { * @see #100 */ @Test - void rendersAllExtraRFC5988Attributes() throws Exception { + void rendersAllExtraRFC8288Attributes() throws Exception { RepresentationModel resourceSupport = new RepresentationModel<>(); resourceSupport.add(Link.of("localhost", "self") // @@ -141,7 +141,7 @@ class Jackson2HalIntegrationTest { * @see #699 */ @Test - void deserializeAllExtraRFC5988Attributes() throws Exception { + void deserializeAllExtraRFC8288Attributes() throws Exception { RepresentationModel expected = new RepresentationModel<>(); expected.add(Link.of("localhost", "self") // @@ -154,7 +154,7 @@ class Jackson2HalIntegrationTest { } @Test - void rendersWithOneExtraRFC5988Attribute() throws Exception { + void rendersWithOneExtraRFC8288Attribute() throws Exception { RepresentationModel resourceSupport = new RepresentationModel<>(); resourceSupport.add(Link.of("localhost", "self").withTitle("the title")); @@ -166,7 +166,7 @@ class Jackson2HalIntegrationTest { * @see #699 */ @Test - void deserializeOneExtraRFC5988Attribute() throws Exception { + void deserializeOneExtraRFC8288Attribute() throws Exception { RepresentationModel expected = new RepresentationModel<>(); expected.add(Link.of("localhost", "self").withTitle("the title"));