requiredString method
Returns the single string stored for name.
Implementation
String requiredString(String name) {
final values = _values[name];
if (values == null || values.isEmpty) {
throw ParameterFormatException('Missing path parameter "$name".');
}
if (values.length != 1) {
throw ParameterFormatException(
'Path parameter "$name" contains more than one segment.',
);
}
return values.single;
}