Open
Description
I'm trying to figure out how I am supposed to use jsonapi to unmarshal an error response I got from my API:
{
"message": "User could not be updated",
"errors": [
{
"code": "E23",
"source": {
"pointer": "/data/attributes/email"
},
"title": "Error Title",
"detail": "More detailed error message",
"meta": {
// object with meta data
}
}
]
}
I first tried
item := new(jsonapi.ErrorsPayload)
err = jsonapi.UnmarshalPayload(errorBody, item)
but this does not work, because jsonapi.UnmarshalPayload
does expect a data
attribute (https://github.com/google/jsonapi/blob/master/request.go#L71). At this point I got lost and I'm not sure how this is supposed to be used...
Metadata
Metadata
Assignees
Labels
No labels