process method
Implementation
@override
process(Request request, ControllerMethodParam methodParam) {
final paramName = name ?? methodParam.name;
final value = request.headers[paramName] ?? methodParam.defaultValue;
if (!methodParam.optional && value == null) {
throw RequestValidationError.header(
EzValidator.globalLocale.required(paramName));
}
final parsedValue = _parseValue(value, methodParam.type);
if (parsedValue == null) {
throw RequestValidationError.header(
EzValidator.globalLocale.isTypeOf('${methodParam.type}', paramName));
}
return parsedValue;
}