resolvedHref property
Uri
get
resolvedHref
Implementation
Uri get resolvedHref {
final hrefUriVariables = _filterUriVariables(href);
if (hrefUriVariables.isEmpty) {
return href;
}
final Map<String, DataSchema> affordanceUriVariables = {
..._thingDescription.uriVariables ?? {},
..._interactionAffordance.uriVariables ?? {},
};
final userProvidedUriVariables = _userProvidedUriVariables;
if (userProvidedUriVariables != null) {
_validateUriVariables(
hrefUriVariables,
affordanceUriVariables,
userProvidedUriVariables,
);
}
// As "{" and "}" are "percent encoded" due to Uri.parse(), we need to
// revert the encoding first before we can insert the values.
final decodedHref = Uri.decodeFull(href.toString());
final expandedHref =
UriTemplate(decodedHref).expand(userProvidedUriVariables ?? {});
return Uri.parse(expandedHref);
}