We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
We're a bit stuck trying to unmarshal the links of a relationship.
Given this abbreviated example from the JSON-API spec:
{ "type": "articles", "id": "1", "attributes": { "title": "JSON API paints my bikeshed!" }, "relationships": { "author": { "links": { "self": "http://example.com/articles/1/relationships/author" } } } }
Reading the spec, it states that an relationship entity with just links (e.g. author -> links -> self) is valid:
author
links
self
How would we read the self link of the Author relationship in this example above?
Here's an attempt of the structs, but this doesn't work:
type Article struct { ID string `jsonapi:"primary,articles"` Title string `jsonapi:"attr,title"` Author *Author `jsonapi:"relation,author"` } type Author struct { SelfLink string `jsonapi:"links,self"` }
The text was updated successfully, but these errors were encountered:
cc @ChrisWhitty
Sorry, something went wrong.
This library does not (yet) support links, meta or errors objects.
Hi @aren55555, thanks for clarifying.
No branches or pull requests
We're a bit stuck trying to unmarshal the links of a relationship.
Given this abbreviated example from the JSON-API spec:
Reading the spec, it states that an relationship entity with just links (e.g.
author
->links
->self
) is valid:How would we read the
self
link of the Author relationship in this example above?Here's an attempt of the structs, but this doesn't work:
The text was updated successfully, but these errors were encountered: