Skip to content

Support Arbitrary User-Defined Links - #164

Merged
jherdman merged 1 commit into
beam-community:masterfrom
jherdman:issue-141
Jan 27, 2019
Merged

Support Arbitrary User-Defined Links#164
jherdman merged 1 commit into
beam-community:masterfrom
jherdman:issue-141

Conversation

@jherdman

Copy link
Copy Markdown
Contributor

JSON:API allows for a links object in the data payload (see
https://jsonapi.org/format/#document-links). Prior to this commit we
only included user-defined links should they be paginating. This commit
ensures these links are always included unless otherwise specified by
the :remove_links option.

Resolves #141

Comment thread lib/jsonapi/serializer.ex Outdated

defp merge_base_links(doc, data, view, conn) do
links =
%{self: view.url_for(data, conn)}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 😁

JSON:API allows for a `links` object in the `data` payload (see
https://jsonapi.org/format/#document-links). Prior to this commit we
only included user-defined links should they be paginating. This commit
ensures these links are always included unless otherwise specified by
the `:remove_links` option.

Resolves beam-community#141
@jherdman
jherdman merged commit 01bd057 into beam-community:master Jan 27, 2019
@jherdman
jherdman deleted the issue-141 branch January 27, 2019 13:41
@jherdman jherdman mentioned this pull request Jan 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants