JSON API would like to provide better support for building hypermedia APIs. Hypermedia APIs are driven by rich linking between resources. This makes it possible to build decoupled applications that are evolvable, self-documenting and discoverable.
The JSON API spec permits links object members to be strings or objects.
When a link is represented as an object, the URL value is placed under an href key.
For example, a next link used to appear like so:
{
"next": "https://www.example.com/jsonapi/node/page?page[offset]=1
}
Now, it appears like so:
{
"next": {
"href": "https://www.example.com/jsonapi/node/page?page[offset]=1,
}
}
Using an object permits the use of an additional meta key to add additional information about the link.
JSON API clients built against the specification should not experience a breaking change, as this is a valid representation of a link.
However, clients built directly against the JSON API module's implementation may experience this as a breaking change and will need to be updated to account for this difference.