spring-hateoas
spring-hateoas copied to clipboard
Add partialExpand to UriTemplate or Link
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)) }
I think this is a duplicate of #544