Skip to content
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

Issue #153: serialize multi-link link rels always as JSON array #154

Merged
merged 2 commits into from Oct 23, 2020

Conversation

kuehlmeyer
Copy link
Contributor

1.) Link class has a new property "IsMultiLink". If true, then the link rel is always rendered as a JSON array, even if there's only one actual link.
2.) When having an enumeration of IResource as property (to represent a list of embedded resources), this also defines the link rel as multi-link link rel, meaning that the links for those embedded resources are also rendered as a JSON array even if there's only one element.
3.) When parsing JSON, the IsMultiLink flag is set depending on the JSON token for a link rel (true for a JSON array, false for a JSON object)
4.) Added unit tests for new functionality. Additionally, the changes result in a different behavior for one unit test (one_item_organisation_list_get_json_test), which was adapted to the new behavior.

…lti-link link relation always as an array.

1.) Link class has a new property "IsMultiLink". If true, then the link rel is always rendered as a JSON array, even if there's only one actual link.
2.) When having an enumeration of IResource as property (to represent a list of embedded resources), this also defines the link rel as multi-link link rel, meaning that the links for those embedded resources are also rendered as a JSON array even if there's only one element.
3.) When parsing JSON, the IsMultiLink flag is set depending on the JSON token for a link rel (true for a JSON array, false for a JSON object)
4.) Added unit tests for new functionality. Additionally, the changes result in a different behavior for one unit test (one_item_organisation_list_get_json_test), which was adapted to the new behavior.
@panmanphil panmanphil merged commit 8997966 into JakeGinnivan:master Oct 23, 2020
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.

None yet

2 participants