@@ -145,29 +145,20 @@ final class AugmentedForm implements Form {
145145 "level: ${uncoveredHrefUriVariables .join (", " )}." );
146146 }
147147
148- final missingTdLevelUserInput = uriVariablesInHref.where (
149- (uriVariableName) =>
150- ! userProvidedUriVariables.containsKey (uriVariableName),
151- );
152-
153- if (missingTdLevelUserInput.isNotEmpty) {
154- throw UriVariableException (
155- "The following URI template variables defined at the TD level are not "
156- "covered by the values provided by the user: "
157- "${missingTdLevelUserInput .join (", " )}. "
158- "Values for the following variables were received: "
159- "${userProvidedUriVariables .keys .join (", " )}." ,
160- );
161- }
162-
163148 // We now assert that all user provided values comply to the Schema
164149 // definition in the TD.
165150 for (final affordanceUriVariable in affordanceUriVariables.entries) {
166151 final key = affordanceUriVariable.key;
167- final value = affordanceUriVariable.value;
168152
169- final schema = JsonSchema .create (value);
170- final result = schema.validate (userProvidedUriVariables[key]);
153+ final userProvidedValue = userProvidedUriVariables[key];
154+
155+ if (userProvidedValue == null ) {
156+ continue ;
157+ }
158+
159+ final schemaValue = affordanceUriVariable.value;
160+ final schema = JsonSchema .create (schemaValue);
161+ final result = schema.validate (userProvidedValue);
171162
172163 if (! result.isValid) {
173164 throw ValidationException ("Invalid type for URI variable $key " );
0 commit comments