JSON:API has support for optional inclusion of related objects.
The specification states that in case the request has an explicit include directive, it MUST NOT include unrequested entities.
If an endpoint supports the include parameter and a client supplies it, the server MUST NOT include unrequested resource objects in the included section of the compound document.
The problem is that calling MarshalPayload will include all related items, whereas MarshalPayloadWithoutIncludedincludes none.
It does not seem to be possible to support this use case with the current version of the library.
JSON:API has support for optional inclusion of related objects.
The specification states that in case the request has an explicit
include
directive, it MUST NOT include unrequested entities.The problem is that calling
MarshalPayload
will include all related items, whereasMarshalPayloadWithoutIncluded
includes none.It does not seem to be possible to support this use case with the current version of the library.