Just out of curiosity, is there any recommended way to parse out "which" parameter goes wrong. For example, we have "unknown_action" before. Now it gets merged into "badvalue", and the response looks like this:
{ "error": { "code": "badvalue", "info": "Unrecognized value for parameter "action": test.", "*": "See https://test2.wikipedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce%3E; for notice of API deprecations and breaking changes." }, "servedby": "mw1361" }
Do I have to parse into .error.info content to know the parameter name? Would its content change (such as localized) under certain situation?
Thanks, Xinyan
-----Original Message----- From: Mediawiki-api mediawiki-api-bounces@lists.wikimedia.org On Behalf Of mediawiki-api-request@lists.wikimedia.org Sent: Wednesday, February 5, 2020 8:00 PM To: mediawiki-api@lists.wikimedia.org Subject: Mediawiki-api Digest, Vol 150, Issue 4
Send Mediawiki-api mailing list submissions to mediawiki-api@lists.wikimedia.org
To subscribe or unsubscribe via the World Wide Web, visit https://lists.wikimedia.org/mailman/listinfo/mediawiki-api or, via email, send a message with subject or body 'help' to mediawiki-api-request@lists.wikimedia.org
You can reach the person managing the list at mediawiki-api-owner@lists.wikimedia.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of Mediawiki-api digest..."
Today's Topics:
1. [Mediawiki-api-announce] BREAKING CHANGE: Parameter validation error codes (Brad Jorsch (Anomie)) 2. [Mediawiki-api-announce] BREAKING CHANGE: Stricter validation of integer-type parameters (Brad Jorsch (Anomie)) 3. Re: [Mediawiki-api-announce] BREAKING CHANGE: Parameter validation error codes (Furkan Gözükara)
----------------------------------------------------------------------
Message: 1 Date: Tue, 4 Feb 2020 13:24:32 -0500 From: "Brad Jorsch (Anomie)" bjorsch@wikimedia.org To: mediawiki-api-announce@lists.wikimedia.org Subject: [Mediawiki-api] [Mediawiki-api-announce] BREAKING CHANGE: Parameter validation error codes Message-ID: CAEepRSsewEZrOO97166BXLsEQxXc2QZ5Gdyxetkwj21yLfdsZw@mail.gmail.com Content-Type: text/plain; charset="utf-8"
The error codes that may be changing are some of those representing invalid values for API parameters. Notably, the following will change:
- "noX", indicating that a required parameter was not specified, becomes "missingparam". - "unknown_X", indicating that an unrecognized value was specified for an enumerated-value parameter, becomes "badvalue". - "too-many-X", indicating that too many values were supplied to a multi-valued parameter, becomes "toomanyvalues". - "baduser_X", "badtimestamp_X", and so on become "baduser", "badtimestamp", and so on.
Note this is not a comprehensive list, other codes may be changing as well.
These changes make the error codes more predictable, at the expense of not indicating in the code which parameter specifically triggered the error. If you have a use case where knowing which parameter triggered the error is needed, please let us know (by replying to this message or by filing a request in Phabricator) and we'll add the necessary error metadata.
The human-readable text is also changing for some of these errors (with or without error code changes), and for a few the error metadata may be changing (e.g. "botMax" changes to "highmax" for limit-type warnings in non-back-compat error formats).
This change will most likely go out to Wikimedia wikis with 1.35.0-wmf.19. See https://www.mediawiki.org/wiki/MediaWiki_1.35/Roadmap for a schedule.
-- Brad Jorsch (Anomie) Senior Software Engineer Wikimedia Foundation -------------- next part -------------- An HTML attachment was scrubbed... URL: https://lists.wikimedia.org/pipermail/mediawiki-api/attachments/20200204/54b4bc1e/attachment-0001.html -------------- next part -------------- _______________________________________________ Mediawiki-api-announce mailing list Mediawiki-api-announce@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce
------------------------------
Message: 2 Date: Tue, 4 Feb 2020 13:24:34 -0500 From: "Brad Jorsch (Anomie)" bjorsch@wikimedia.org To: mediawiki-api-announce@lists.wikimedia.org Subject: [Mediawiki-api] [Mediawiki-api-announce] BREAKING CHANGE: Stricter validation of integer-type parameters Message-ID: CAEepRSs8vkkwQD_xKv2WR+qmJnzxhD9Uv_LfRc81bUQeYw5KoA@mail.gmail.com Content-Type: text/plain; charset="utf-8"
Various unusual values for integer-type parameters to the Action API will no longer be accepted. Acceptable values will consist of an optional sign (ASCII `+` or `-`) followed by 1 or more ASCII digits.
Values that were formerly allowed, and will now result in a "badinteger" error, include:
- Values with extraneous whitespace, such as " 1". - "1.9", formerly interpreted as "1". - "1e1", formerly interpreted as either "1" or "10" at various times. - "1foobar", formerly interpreted as "1" - "foobar", formerly interpreted as "0".
Most clients should already be using correct formats, unless they are taking direct user input without validation.
This change will most likely go out to Wikimedia wikis with 1.35.0-wmf.19. See https://www.mediawiki.org/wiki/MediaWiki_1.35/Roadmap for a schedule.
-- Brad Jorsch (Anomie) Senior Software Engineer Wikimedia Foundation -------------- next part -------------- An HTML attachment was scrubbed... URL: https://lists.wikimedia.org/pipermail/mediawiki-api/attachments/20200204/3171202e/attachment-0001.html -------------- next part -------------- _______________________________________________ Mediawiki-api-announce mailing list Mediawiki-api-announce@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce
------------------------------
Message: 3 Date: Tue, 4 Feb 2020 23:52:58 +0300 From: Furkan Gözükara monstermmorpg@gmail.com To: "MediaWiki API announcements & discussion" mediawiki-api@lists.wikimedia.org Subject: Re: [Mediawiki-api] [Mediawiki-api-announce] BREAKING CHANGE: Parameter validation error codes Message-ID: CAB+rNzBACGY79rSbtm0bRz8JFwEEeNW5kYSskPGY2rS55ocaTA@mail.gmail.com Content-Type: text/plain; charset="utf-8"
How can i get file full path from file template?
For example * {{audio|en|en-us-dictionary.ogg|Audio (US, California)}}
On Tue, Feb 4, 2020 at 9:25 PM Brad Jorsch (Anomie) bjorsch@wikimedia.org wrote:
The error codes that may be changing are some of those representing invalid values for API parameters. Notably, the following will change:
- "noX", indicating that a required parameter was not specified,
becomes "missingparam".
- "unknown_X", indicating that an unrecognized value was specified for
an enumerated-value parameter, becomes "badvalue".
- "too-many-X", indicating that too many values were supplied to a
multi-valued parameter, becomes "toomanyvalues".
- "baduser_X", "badtimestamp_X", and so on become "baduser",
"badtimestamp", and so on.
Note this is not a comprehensive list, other codes may be changing as well.
These changes make the error codes more predictable, at the expense of not indicating in the code which parameter specifically triggered the error. If you have a use case where knowing which parameter triggered the error is needed, please let us know (by replying to this message or by filing a request in Phabricator) and we'll add the necessary error metadata.
The human-readable text is also changing for some of these errors (with or without error code changes), and for a few the error metadata may be changing (e.g. "botMax" changes to "highmax" for limit-type warnings in non-back-compat error formats).
This change will most likely go out to Wikimedia wikis with 1.35.0-wmf.19. See https://www.mediawiki.org/wiki/MediaWiki_1.35/Roadmap for a schedule.
-- Brad Jorsch (Anomie) Senior Software Engineer Wikimedia Foundation _______________________________________________ Mediawiki-api-announce mailing list Mediawiki-api-announce@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce _______________________________________________ Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
-------------- next part -------------- An HTML attachment was scrubbed... URL: https://lists.wikimedia.org/pipermail/mediawiki-api/attachments/20200204/2a5e7545/attachment-0001.html
------------------------------
Subject: Digest Footer
_______________________________________________ Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
------------------------------
End of Mediawiki-api Digest, Vol 150, Issue 4 *********************************************