Page MenuHomePhabricator

Documentation for "section" parameter of Edit API says "number" but should be "identifier"
Closed, ResolvedPublicBUG REPORT

Description

The docstring for the section parameter in the Edit API currently says:

Section number. 0 for the top section, new for a new section.

I'm told (and comments in other tasks seem to confirm) that this is misleading. Wikipage sections can have non-numeric identifiers due to transclusion (T-123), and apparently the API accepts these as is. In other words, the docstring should be something like:

Section identifier. 0 for the top section, new for a new section. Often a positive integer, but can also be non-numeric.

The key part being to change the nomenclature to "identifier" rather than "number"; the rest is just to make it easier on users of the API docs (I've seen people with +2 try to cast these to int).

Event Timeline

Change 762113 had a related patch set uploaded (by Xover; author: Xover):

[mediawiki/core@master] API: More precise docstring for API:Edit's \"section\" parameter

https://gerrit.wikimedia.org/r/762113

Change 762113 merged by jenkins-bot:

[mediawiki/core@master] API: More precise docstring for API:Edit's section-related parameters

https://gerrit.wikimedia.org/r/762113

matmarex assigned this task to Xover.
matmarex subscribed.

Thank you for the patch!