Issue #153: serialize multi-link link rels always as JSON array #154
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.