jakartaee / jakartaee/rest

Add abstraction for Link Relation Type

Open
#421 3 comments 0 reactions 1 assignee View on GitHub

@glassfishrobot is already working on this.

Since Feb 10, 2018.

Component: hypermedia
Dominant language
Java
Stars
400
Forks
143
PR merge metrics
No merged PRs in 30d

Description

It would be useful for the API to specify an abstraction for Link Relation Type in a similar manner to the abstraction of Media Type (javax.ws.rs.core.MediaType).

RFC 5988 defines 'Registered Relation Types' (as maintained by [IANA here](http://www.iana.org/assignments/link-relations/link-relations.xml#link-relations-1)) and 'Extension Relation Types' which are somewhat more local.

It is noted that the list of 'Registered Relation Types' changes (infrequently) and therefore would introduce a degree of ongoing maintenance.

It is also noted that RFC 5988 indicates that 'Extension Relation Types' are URIs which SHOULD be lowercase.

It would be useful for implementors to be able to easily implement compliant Extension Relation Types, and that single entry point could be used to resolve either from a String based value (by a valueOf() method for instance).

Additionally, this would allow the Link.Builder interface to support setting of the "rel" by LinkRelationType, allow implementors to use a List in the Builder implementation, and generally increase the robustness in this area.

I can provide a Gist of something I'm working with if that's useful.
#### Affected Versions
[2.0]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.