-
Notifications
You must be signed in to change notification settings - Fork 37
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
Discuss new LinkType.Top #201
Comments
I think this makes sense, but I'm not sure I understand the reasoning for calling this |
Totally makes sense. And as i renamed it to TopSelf and you merged it, i'm closing this defect. Thanks! |
@joukevandermaas or if you think that CollectionSelf is better, i can rename it and make new PR |
Hi Jouke,
I wanted to ask one thing and i can make PR to add it, but wanted to get your opinion about it.
We have a case when we have endpoint that returns collection of items and we don't want to add additional endpoint to get specific item. The problem with the links as by default it will generate both
self
in each item and thenlinks->self
at top level. We want to be able to generate top levelself
but withoutself
on each item level.Right now it's impossible as if i set
WithLinks(Saule.LinkType.Related);
in the resource description, then it wont generate bothself
links and we need that top one.Is it ok to add
LinkType.Top
like thisSo then i can specify
LinkTypes.Top
and it will display only toplinks.self
section withoutself
for each item.And to prevent existing behavior i can check in the code (ResourceSerializer.CreateTopLevelLinks) to render top
self
link only ifSo existing code will work fine as Self would be treated as Top too. And if someone doesnt want it, then he can specify it in the resource as
LinkType.Top & ~LinkType.Self
The text was updated successfully, but these errors were encountered: