Currently, all API parameters type checking is done in ApiBase::getParameterFromSettings AFAIK. This method is 238 lines-long. This is confusing and lacks the possibility for extension.
The first thing that could be done is move type-checking in separate type-checker classes responsible for everything regarding one type (from error reporting - e.g. for invalid values etc. - to value determining from default value, type etc.)
I propose something like:
abstract class ApiParamTypechecker { public abstract function __construct(array $data); public abstract function validate(); }
What do you think? I could go ahead and implement something if you think this would be a good idea!