@@ -44,9 +44,8 @@ final class AugmentedForm implements Form {
4444 @override
4545 String get contentType => _form.contentType;
4646
47- /// Resolves all [_userProvidedUriVariables] in this [Form] and returns the
48- /// resulting [Uri] .
49- Uri get _resolvedHref {
47+ @override
48+ Uri get href {
5049 final baseUri = _thingDescription.base ;
5150
5251 if (baseUri != null ) {
@@ -56,39 +55,6 @@ final class AugmentedForm implements Form {
5655 return _form.href;
5756 }
5857
59- @override
60- Uri get href {
61- final href = _resolvedHref;
62- final hrefUriVariables = _filterUriVariables (href);
63-
64- if (hrefUriVariables.isEmpty) {
65- return href;
66- }
67-
68- final Map <String , DataSchema > affordanceUriVariables = {
69- ..._thingDescription.uriVariables ?? {},
70- ..._interactionAffordance.uriVariables ?? {},
71- };
72-
73- final userProvidedUriVariables = _userProvidedUriVariables;
74-
75- if (userProvidedUriVariables != null ) {
76- _validateUriVariables (
77- hrefUriVariables,
78- affordanceUriVariables,
79- userProvidedUriVariables,
80- );
81- }
82-
83- // As "{" and "}" are "percent encoded" due to Uri.parse(), we need to
84- // revert the encoding first before we can insert the values.
85- final decodedHref = Uri .decodeFull (href.toString ());
86-
87- final expandedHref =
88- UriTemplate (decodedHref).expand (userProvidedUriVariables ?? {});
89- return Uri .parse (expandedHref);
90- }
91-
9258 @override
9359 List <OperationType > get op =>
9460 _form.op ?? OperationType .defaultOpValues (_interactionAffordance);
@@ -129,6 +95,38 @@ final class AugmentedForm implements Form {
12995 .toList (growable: false );
13096 }
13197
98+ /// Resolves all [_userProvidedUriVariables] in this [Form] and returns the
99+ /// resulting [Uri] .
100+ Uri get resolvedHref {
101+ final hrefUriVariables = _filterUriVariables (href);
102+
103+ if (hrefUriVariables.isEmpty) {
104+ return href;
105+ }
106+
107+ final Map <String , DataSchema > affordanceUriVariables = {
108+ ..._thingDescription.uriVariables ?? {},
109+ ..._interactionAffordance.uriVariables ?? {},
110+ };
111+
112+ final userProvidedUriVariables = _userProvidedUriVariables;
113+ if (userProvidedUriVariables != null ) {
114+ _validateUriVariables (
115+ hrefUriVariables,
116+ affordanceUriVariables,
117+ userProvidedUriVariables,
118+ );
119+ }
120+
121+ // As "{" and "}" are "percent encoded" due to Uri.parse(), we need to
122+ // revert the encoding first before we can insert the values.
123+ final decodedHref = Uri .decodeFull (href.toString ());
124+
125+ final expandedHref =
126+ UriTemplate (decodedHref).expand (userProvidedUriVariables ?? {});
127+ return Uri .parse (expandedHref);
128+ }
129+
132130 void _validateUriVariables (
133131 List <String > uriVariablesInHref,
134132 Map <String , DataSchema > affordanceUriVariables,
0 commit comments