Closed vdytynyuk closed 7 years ago
It's fine, it's not yet implemented. I will do that. Can you provide an example of what do you expect?
@deblockt For instance I receive such template - runs/42/files{/path*} and I want to be able to nicely concatenate some path to the prefix of this link. Is it possible?
@deblockt
Spring Data for example also provides some URLs that take optional parameters like /bookings{?projection}
. So if you call the URL, I want to be able to add a value for that parameter. So in the end, the URL looks like /bookings?projection=excerpt
. Without setting the parameter, the URL should read /bookings
.
Will you consider this too?
Yes, i will consider that. But this breaks the existing functioning of links I will study this issue.
Templated links are now supported on version 0.3.0.
When you call fetch
method you can pass object as argument to set url parameters (see https://github.com/deblockt/hal-rest-client#follow-a-templated-link).
Warning, now HalResource.uri
is an URI object and not a string (see https://github.com/deblockt/hal-rest-client#from-o2).
It seems that library doesn't work with parsing template links. Are you going to implement templates support?