Is there a way to exclude or customize the links object from a relationship? I've been trying to do figure this out without any luck.
Some context:
I have some resource types I want to include links for, and other resource types I do not. So I'm using jsonapi.MarshalWithURLs and then using a GetCustomLinks method to return an empty map for the resources that should not have links.
This is working for the included part of the marshaled payload. However, the links are still included in the relationships part of the payload. What's returned by GetCustomLinks does not appear to impact the link values in the relationships object.
Which is resulting in the following 2 problems:
- links present for some related resources where I don't want them
- links incorrect for other related resources where I've customized them
Is there a way to exclude or customize the
linksobject from a relationship? I've been trying to do figure this out without any luck.Some context:
I have some resource types I want to include links for, and other resource types I do not. So I'm using
jsonapi.MarshalWithURLsand then using aGetCustomLinksmethod to return an empty map for the resources that should not have links.This is working for the
includedpart of the marshaled payload. However, the links are still included in therelationshipspart of the payload. What's returned byGetCustomLinksdoes not appear to impact the link values in therelationshipsobject.Which is resulting in the following 2 problems: