-
Notifications
You must be signed in to change notification settings - Fork 215
UnmarshalManyPayload with Links #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It's insane how this can be considered useable without the ability of deserialising a list of objects. |
@edisonspencer there is currently no one liner way to unmarshal a payload of the form:
However you can do something like: payload := new(ManyPayload)
if err = json.NewDecoder(in).Decode(payload); err != nil {
t.Fatal(err)
} And payload.Links should contain the Links Object at the |
I believe the link in #68 (comment) should be https://github.com/google/jsonapi/blob/master/request_test.go#L694 |
Also, it would be more helpful to have a working example that demarshalled a structure that used jsonapi structure tags. |
Hi,
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?
Thanks.
The text was updated successfully, but these errors were encountered: