-
Notifications
You must be signed in to change notification settings - Fork 471
ControllerLinkBuilder to create templated links #234
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
Comments
Here's the best that I could come up with munging together different solutions..
I'd love it if you had something better though.. |
Has there been any progress on this issue? I'd like to use templated links as well. |
Is this the same as #169 ? |
At a high level it's the same kind of problem. The difference between the two is that this issue isn't about pagination or PagedResources.. I need this kind of link building for any parameters. |
Ok, from that perspective I agree. Btw. I need it also for any kind of params. As a quick fix, I will try to "copy" the current builder and change it to behave like I want. But this is ugly and I really like to get rid of that technical dept. @olivergierke If you can point out some kind of implementation idea, I am willing to write the code. I am just not deep enough into the source (and sadly no spare time left to do so) to create this on my own. Otherwise, I could push over my "hacked" version of the builder, if I get it working. Maybe this could be a start. |
Yeah on our project, we're pretty much doing what I outlined above (and have polluted our Resource/ResourceBuilder classes).. I think the existing stack is useful for making links from a known entity to another.. like when I have a ParentResource making a link to a collection of ChildResource objects. The problem I have is how to get the link/rel to the collection of ParentResource objects that have no parent? I'm not sure how hateoas solves this problem in general, but the 'hack' we're using allows us to make templated links that return objects that have no Parent context. E.g. when I have a front-end url like /parent/1 and I want to view Parent #1 without the 'context' of a search happening. |
Is there anything planned for this feature? I'd say it's one of the most basic ideas for HATEOAS, but the support could be better. |
Resolving as a duplicate of #169. |
So my issue is that I would like to use the ControllerLinkBuilder to generate rfc6570 links. Right now it works fine with parameter substitution when I know the parameter values..
I'd love to be able to do something like this:
Link link = linkTo(methodOn(ClientsResource.class).get(DUMMY)).withRel("clientById")
To point to the method:
I can obviously do that when I have a true parameter for the ID but I'd like to be able to publish a link to my application client in a templated way so that the link comes back as:
http://localhost:8080/whatever/clients{/id}
.This would also help me on 'search' kinds of links where the parameters are variable.
The text was updated successfully, but these errors were encountered: