spring-hateoas icon indicating copy to clipboard operation
spring-hateoas copied to clipboard

Add partialExpand to UriTemplate or Link

Open lmtoo opened this issue 5 years ago • 1 comments
trafficstars

partialExpand UriTemplate or Link is so commonly used ,when build Links from RepositoryEntityLinks , which is convenience don't required developer build link from scratch. I have a kotlin's extensions to UriTemplate:

@JvmName("partialExpand") fun UriTemplate.partialExpand(defaults: Map<String, Any>):UriTemplate { val variables = variables.filter { it.name !in defaults } return UriTemplate.of(expand(defaults).toUriComponentsBuilder().toUriString(), TemplateVariables(variables)) }

lmtoo avatar Sep 10 '20 15:09 lmtoo

I think this is a duplicate of #544

sfussenegger avatar Oct 25 '23 13:10 sfussenegger