API examples on mediawiki.org should probably be updated to use json now json is default
Open, LowPublic


[16:05:40] <cgt> Also, it's a bit annoying that all the example API responses are in XML instead of JSON. Hopefully that will be changed once the XML API is deprecated.

We should just probably update them now json is the default format for the MW API

Reedy created this task.Feb 16 2015, 4:12 PM
Reedy updated the task description. (Show Details)
Reedy raised the priority of this task from to Needs Triage.
Reedy added a subscriber: Reedy.
Restricted Application added a project: Documentation. · View Herald TranscriptFeb 16 2015, 4:12 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Cgt added a subscriber: Cgt.Feb 16 2015, 4:29 PM

I'll get to work on this bug this week.

Krenair assigned this task to Cgt.Feb 16 2015, 4:51 PM
Krenair set Security to None.
Krenair added a subscriber: Krenair.
In T89660#1041690, @Cgtdk wrote:

I'll get to work on this bug this week.

Thanks Cgtdk. When you do so I would leave out the current warning in API results:

"warnings": {
    "query": {
        "*": "Formatting of continuation data will be changing soon. To continue using the current formatting, use the 'rawcontinue' parameter. To begin using the new format, pass an empty string for 'continue' in the initial query."

BTW there's a related task T89318: Replace on-wiki API documentation with Special:ApiHelp transclusion. If the API section of a page just restates the output of api.php?action=help , you can transclude the latter and remove the wiki text. The API examples in api.php?action=help don't include their static JSON output (you have to click to see it), but it's worth losing that feature to avoid duplication.

(I'm a Tech Writer at WMF)

Cgt added a comment.Feb 17 2015, 1:11 PM

Thank you, @Spage. I will keep that in mind. I am not quite sure what you mean by “static JSON output (you have to click to see it)”. Would you please elaborate on that?

And just to make sure I fully understand what you are suggesting: should I replace the “parameters” section https://www.mediawiki.org/wiki/API:Edit#Parameters with {{TNT|Api help|edit}}? I tried doing this on mw:User:Cgtdk/Sandbox, but it creates a H2 HTML header instead of an H3 header, which would be more visually and semantically appropriate in this context. Also, the header “action=edit” is much less meaningful in this context than “parameters”. I tried keeping the “parameters” header at first, but that just makes it even more semantically and visually confusing because the “parameters” header is an H3.

Anomie moved this task from Unsorted to Non-Code on the MediaWiki-API board.Feb 19 2015, 6:00 PM
jayvdb added a subscriber: jayvdb.Mar 19 2015, 10:00 AM
Aklapper triaged this task as Low priority.Mar 23 2015, 8:57 PM
waldyrious added a subscriber: waldyrious.