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 #288 Allow links on particular rels to be displayed as an array even if there is only one link #295

Closed

Conversation

vivin
Copy link

@vivin vivin commented Feb 13, 2015

This change allows links behind certain rels to always be wrapped by an array regardless of cardinality.

This is related to #291. Instead of trying to control the wrapping based on a resource-rel combination, this approach controls the representation of the link simply based on the rel. Hence, if the specified rels appear in any resource, they will always be wrapped inside an array regardless of cardinality.

I think this allows for the development of more-consistent representations. If there is ever more than one link behind a particular rel (under any resource), I think it makes more sense to maintain that consistency across all resources by ensuring that the links under that rel are always wrapped in an array.

@vivin vivin changed the title issue #288 issue #288 Allow links on particular rels to be displayed as an array even if there is only one link Feb 13, 2015
@vivin
Copy link
Author

vivin commented Feb 13, 2015

@olivergierke Please let me know if this approach makes more sense. Thanks!

@vivin
Copy link
Author

vivin commented Feb 23, 2015

@olivergierke Have you had a chance to look at this?

@vivin
Copy link
Author

vivin commented Mar 2, 2015

@olivergierke I'd appreciate some feedback on this when you get a chance. It's a feature that I'd like to get in (with whatever changes you think are necessary) because it's having an impact on an API that I'm currently building.

@vivin vivin force-pushed the allow-multiple-links-approach-3 branch from 56b7e73 to bd43d47 Compare March 10, 2015 16:42
This change allows links behind certain rels to always be wrapped by an array regardless of cardinality.
@vivin vivin force-pushed the allow-multiple-links-approach-3 branch from bd43d47 to 9f5e923 Compare September 25, 2015 23:19
@vivin
Copy link
Author

vivin commented Sep 28, 2015

@olivergierke I've updated this PR and renamed the class to HalCollectionRels.

@odrotbohm odrotbohm force-pushed the master branch 2 times, most recently from 4ebc1be to 266ad50 Compare July 25, 2016 18:32
@chasecaleb
Copy link

@olivergierke I'm not sure if you aren't interested in this PR or you haven't had time to approve it, but I'm using this project at work and it would be a big help in simplifying client code.

@edrik
Copy link

edrik commented Nov 21, 2016

+1

1 similar comment
@ch4mpy
Copy link

ch4mpy commented Mar 22, 2017

+1

@pivotal-issuemaster
Copy link

@vivin Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-issuemaster
Copy link

@vivin Thank you for signing the Contributor License Agreement!

gregturn added a commit that referenced this pull request May 22, 2017
Provide the means to render a single link entry as a JSON Array.

Original pull-request: #295
Related issues: #291
@gregturn gregturn self-assigned this May 22, 2017
gregturn added a commit that referenced this pull request Sep 11, 2017
Provide the means to render a single link entry as a JSON Array.

Original pull-request: #295
Related issues: #291
odrotbohm pushed a commit that referenced this pull request Oct 13, 2017
…ng options.

We now expose HalConfiguration to be defined as Spring bean in user configuration to control certain aspects of the HAL rendering. Initially we allow to control whether links shall always be rendered as collection. If no user-provided bean is available, we register a default instance.

Original pull request: #295
Related issues: #291
odrotbohm added a commit that referenced this pull request Oct 13, 2017
Moved RenderSingleLinks enum into HalConfiguration. Simplified HalConfiguration setup by moving the default into the class. The lookup of a user-provided HalConfiguration is now handled on the bean name level to avoid premature initialization of a potentially defined bean. Formatting.

Original pull request: #295
Related issues: #291
@gregturn
Copy link
Contributor

Resolved via 7cd1fb8.

@gregturn gregturn closed this Dec 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants