Last modified: 2014-08-07 19:24:42 UTC
api action=options has a documentated feature: "If no value is given (not even an equals sign), the option will be reset to its default value" But the query api.php?action=options&change=skin&token= will give "Validation error for 'skin': ", because HTMLRadioField::validate will return false on the given null value and that false is converted to a empty string. When it will return true, the null is passed to User::setOption and than gets it default value, which is okay.
When not passed a value to set the option to, ApiOptions should either skip the validation attempt (relying on $user->setOption to handle null properly) or should fetch the default itself from User::getDefaultOption. The former seems slightly easier, while the latter seems slightly cleaner. I don't see a whole lot of reason to prefer either way.
Change 123367 had a related patch set uploaded by Konarak: Handle defaults for api action=options https://gerrit.wikimedia.org/r/123367