-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add hydra:collection to resources #63
Comments
@angelo-v what do you think? |
I did not use Alceaus yet, so I am not sure which fits better in the "thinking" of it. In general I think collections are a core element of each API and it does not feel like bloat to me. In contrast, I would like to have more specific ways to find collections in an API, e.g. to say something like |
Thanks for sharing your thoughts. I actually came to this conclusion through different reasoning. If you remember, I mentioned to you and Karol that in a PoC I used
Interesting idea. Such snippets have floated around the spec repository although I'm not sure what is the practical application yet. Also, the |
As surfaced but HydraCG/api-examples#4, Alcaeus needs to natively support
hydra:collection
property.I can think of two ways to add it to the API.
First would be to implicitly treat
hydra:collection
as ahydra:Link
property. I would add agetLinks()
method to the base resource type so which gathers explicit links and collections in a single array.I favour this approach as it will play nice with the generic app and is one less place too look at when processing Hydra representations.
Alternatively, a dedicated property/method could be introduced which only accesses the related collections.
I do feel though that it's just bloat.
The text was updated successfully, but these errors were encountered: