Skip to content
ADP
API Design PrincipleBETA

[ADP-322] Hypermedia Alternatives

Guidance

  • SHOULD consider alternatives to HAL (Hypertext Application Language) for structuring hypermedia responses, as HAL may not be suitable for all applications and can complicate JSON structures.
  • SHOULD explore alternatives such as using the standard HTTP header Link to replace links in hypermedia.
  • Instead of using Hypermedia's embed, it is recommended to embed related resources according to [ADP-360].
  • If Hypermedia is deemed necessary for your API design, consider using HAL as the Hypermedia implementation.

Examples

http
Link: <http://api.example.com/users/1/friends>; rel="friends"

Example of JSON Representation without HAL

json
{
  "links": {
    "self": "http://api.example.com/users/1",
    "friends": "http://api.example.com/users/1/friends"
  },
  "name": "John Doe",
  "age": 30
}

References