Relationship Data properties may contain a single ResourceIdentifier or an array of ResourceIdentifiers, based on the type of relationship. To support this, Data is currently a JToken. This is not ideal, as it requires a lot of checks on Data.TokenType for Object or Array.
A far better solution would be an IRelationship or abstract base class, with a custom JsonConverter for that type, that switches deserialization based on TokenType.
The same approach should apply to Resource and other types that have newtonsoft.json types.
Relationship Data properties may contain a single ResourceIdentifier or an array of ResourceIdentifiers, based on the type of relationship. To support this, Data is currently a JToken. This is not ideal, as it requires a lot of checks on Data.TokenType for Object or Array.
A far better solution would be an IRelationship or abstract base class, with a custom JsonConverter for that type, that switches deserialization based on TokenType.
The same approach should apply to Resource and other types that have newtonsoft.json types.