Examples
Example with more than one block
A single block returns "messagecode": "blocked"
Example with more than one password error
Creating an account with password "foobar":
{ "createaccount": { "status": "FAIL", "message": "* Passwords must be at least 8 characters.\n* The password entered is in a list of very commonly used passwords. Please choose a more unique password.", "messagecode": "___1____2", "canpreservestate": false } }
(Also from @dom_walden)
What's the problem?
This seems to be caused by the following:
- The code is set to the message key in ApiMessageTrait: https://gerrit.wikimedia.org/g/mediawiki/core/+/3af76512c7dfd4008dca0365d73819bac27e6c70/includes/api/ApiMessageTrait.php#97
- The message key is set to a bullet list with a numerical parameter for each error message in StatusFormatter::getMessage (or Status::getMessage): https://gerrit.wikimedia.org/g/mediawiki/core/+/3af76512c7dfd4008dca0365d73819bac27e6c70/includes/Status/StatusFormatter.php#182