-
Notifications
You must be signed in to change notification settings - Fork 473
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
issue #288 Allow links on particular rels to be displayed as an array even if there is only one link #295
Conversation
@olivergierke Please let me know if this approach makes more sense. Thanks! |
@olivergierke Have you had a chance to look at this? |
@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. |
56b7e73
to
bd43d47
Compare
This change allows links behind certain rels to always be wrapped by an array regardless of cardinality.
bd43d47
to
9f5e923
Compare
@olivergierke I've updated this PR and renamed the class to |
4ebc1be
to
266ad50
Compare
@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. |
+1 |
1 similar comment
+1 |
@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. |
@vivin Thank you for signing the Contributor License Agreement! |
…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
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
Resolved via 7cd1fb8. |
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.