Page MenuHomePhabricator

Selective use of formatversion=2
Open, LowPublicFeature


API formatversion=2 (available as of mw 1.25) gives us good things like proper booleans. We like good things.

It may not be completely stable but we can selectively enable it for specific tasks.

Related Objects

Event Timeline

Sn1per claimed this task.
Sn1per raised the priority of this task from to Needs Triage.
Sn1per updated the task description. (Show Details)
Sn1per added a project: Pywikibot.

First step is detecting whether it is available.

It will be most suitable where compatibility with old MediaWiki versions is not needed; otherwise we need code to support v1 responses and alternative code to support v2 responses, or some voodoo somewhere to make v1 look like v2.

Seems formatversion is not officially propagated. A lot of API documentation still describes the "old" format [1] or the new usage is not documented [2]. Is there any timeline for a switch?
To support formatversion 2 I propose to give up support of MediaWiki 1.23-1.26 and start support with the next LTS 1.27 (perhaps with Pywikibot 8)

[1] for example

Xqt changed the subtype of this task from "Task" to "Feature Request".Apr 21 2022, 2:40 PM

Change 840161 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] [IMPR] Use API formatversion 2 with userinfo

Change 840161 merged by jenkins-bot:

[pywikibot/core@master] [IMPR] Use API formatversion 2 with userinfo