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
{{ message }}
This repository was archived by the owner on Sep 4, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 4, 2025. It is now read-only.
I've been trying to use the jsonapi for marshaling and unmarshaling a JSON object containing links, and I am able to marshal the JSON object (and have the links section in it), however, I am not able to unmarshal and extract the link from the JSON object.
I am unable to find any code sample, even in the tests, to see how it could be done. Is this information lost when the unmarshal is done through this library? is there any workaround which is not clear?
Activity
ChrisCooney commentedon Jan 26, 2017
It's insane how this can be considered useable without the ability of deserialising a list of objects.
aren55555 commentedon Jan 27, 2017
@edisonspencer there is currently no one liner way to unmarshal a payload of the form:
However you can do something like:
And payload.Links should contain the Links Object at the
"links"top level member. See this test for a more complete example: https://github.com/google/jsonapi/blob/master/request_test.go#L553rberlind commentedon Nov 9, 2020
I believe the link in #68 (comment) should be https://github.com/google/jsonapi/blob/master/request_test.go#L694
rberlind commentedon Nov 9, 2020
Also, it would be more helpful to have a working example that demarshalled a structure that used jsonapi structure tags.