You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'd like to create resource with following relationship my_relation, which only contains links property, ie. there is no data property with resource linkage:
A “relationship object” MUST contain at least one of the following:
- links: a links object
- data: resource linkage
- meta: a meta object that contains non-standard meta-information about the relationship.
Is there any way how to accomplish this now, with version 2 of the library? It was possible with version 1:
However now there seems to be only ToNull, ToOne and ToMany relation, neither of which accomplishes exactly this (eg. ToNull adds data: null to the relationship).
The text was updated successfully, but these errors were encountered:
Yep, you're right. The "at least one" clause makes data optional. Seems like introducing some sort of an EmptyRelationship implements ResourceField might solve this. What do you think?
👍 Yes, this is basically what I did as workaround. Though I'm not sure about EmptyRelationship name - it suggest the relationship is empty, but it just does not contain the linkage identifier (ResourceIdentifier). However I can't think of better suggestion :)
Hi,
I'd like to create resource with following relationship
my_relation
, which only containslinks
property, ie. there is nodata
property with resource linkage:This is allowed as per JSON:API spec:
Is there any way how to accomplish this now, with version 2 of the library? It was possible with version 1:
However now there seems to be only
ToNull
,ToOne
andToMany
relation, neither of which accomplishes exactly this (eg. ToNull addsdata: null
to the relationship).The text was updated successfully, but these errors were encountered: