Closed
Description
Is your feature request related to a problem? Please describe.
The package does not support unmarshalling top-level links, usually utilizes for pagination.
Describe the solution you'd like
UnmarshalOption to export the links from top-level, which has been done with meta. for example:
body := `{"data":{"id":"1","type":"articles","attributes":{"title":"Hello World"}},"links":{"self":"foobar"}}`
type Article struct {
ID string `jsonapi:"primary,articles"`
Title string `jsonapi:"attribute" json:"title"`
}
var (
a Article
l jsonapi.Link
)
err := jsonapi.Unmarshal([]byte(body), &a, jsonapi.UnmarshalLinks(&l))
// l.self = "foobar"
Describe alternatives you've considered
n/a