ResourceMetadata metadata = mappings.getMappingFor(type);
String mappedId = idConverters.getPluginFor(type, DefaultIdConverter.INSTANCE).toRequestId((Serializable) id, type);
Link link = linkFor(type).slash(mappedId).withRel(metadata.getItemResourceRel());
ProjectionDefinitionConfiguration projectionConfiguration = config.projectionConfiguration();
if (!projectionConfiguration.hasProjectionFor(type)) {
return link;
}
String parameterName = projectionConfiguration.getParameterName();
TemplateVariables templateVariables = new TemplateVariables(new TemplateVariable(parameterName, REQUEST_PARAM));
UriTemplate template = new UriTemplate(link.getHref(), templateVariables);
return new Link(template.toString(), metadata.getItemResourceRel());
}