Include `rel` attribute when hash is added to link object key

Created on 23 May 2023, over 1 year ago

Problem/Motivation

There is logic in the normalizer to add a unique hash to any duplicate link keys because there is no provision for duplicates and JSON:API does not support arrays of links.

OK, that's fine, but I _think_ this now means that it is difficult to programmatically "infer" the link relation type from the key with a simple equality match. You'd have to do something like String.prototype.startsWith() on the keys, which is a little weird. The link object specification already has provision for a rel member, so let's use it in this case. Yes, it results in a bit of duplication, but not much, and it makes these links much friendlier to machine parsing.

Steps to reproduce

Proposed resolution

Add the `rel` key if the link is part of a multiple-group.

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States bradjones1 Digital Nomad Life

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024