protected function validateSingleType($value, string $type, ValidationField $field) {
        switch ($type) {
            case 'boolean':
                $result = $this->validateBoolean($value, $field);
                break;
            case 'integer':
                $result = $this->validateInteger($value, $field);
                break;
            case 'number':
                $result = $this->validateNumber($value, $field);
                break;
            case 'string':
                $result = $this->validateString($value, $field);
                break;
            case 'timestamp':
                trigger_error('The timestamp type is deprecated. Use an integer with a format of timestamp instead.', E_USER_DEPRECATED);
                $result = $this->validateTimestamp($value, $field);
                break;
            case 'datetime':
                trigger_error('The datetime type is deprecated. Use a string with a format of date-time instead.', E_USER_DEPRECATED);
                $result = $this->validateDatetime($value, $field);
                break;
            case 'array':
                $result = $this->validateArray($value, $field);
                break;
            case 'object':
                $result = $this->validateObject($value, $field);
                break;
            case 'null':
                $result = $this->validateNull($value, $field);
                break;
            case '':
                // No type was specified so we are valid.
                $result = $value;
                break;
            default:
                throw new \InvalidArgumentException("Unrecognized type $type.", 500);
        }
        return $result;
    }