Page MenuHomePhabricator

The formatted API result page should link to module-specific API help.
Open, LowPublicFeature

Description

Human-readable API results (default or format=xmlfm, etc.) show a useful header api-format-prettyprint-header

"This is the HTML representation of the $1 format. ... See the complete documentation, or the API help for more information"

The API help main page lists 90 API modules, one of which is query, and you can eventually find your submodule's help. Stephen Niedzielski commented "a nice improvement would be to link to the specific API used".
For example,
https://en.wikipedia.org/w/api.php?action=query&prop=pageimages&titles=Tomato
would link to the module help for pageimages at
Special:ApiHelp/query+pageimages
(which ends up at https://en.wikipedia.org/w/api.php?action=help&modules=query%2Bpageimages)

It's a little tricky when the API request invokes multiple actions, multiple query submodules, generator, etc.. AIUI api.php can display help for multiple modules on one page but there's no TOC; it might be easier and better to provide multiple links:

... See the API help (main page - query - pageimages submodule - prefixsearch submodulemodule)

The prettyprint header could also output a try in ApiSandbox link to load the query into ApiSandbox, similar to T89229: API Help should generate [try in ApiSandbox] link to Special:ApiSandbox#action=params from getExamples().

Event Timeline

Spage raised the priority of this task from to Needs Triage.
Spage updated the task description. (Show Details)
Spage added subscribers: Spage, Sniedzielski.

It's a little tricky when the API request invokes multiple actions

You can't have more than one action, but every request is going to involve at least three modules: "main", the action (default "help"), and the formatter (default "jsonfm"). Query, of course, might have many more.

The prettyprint header could also output a try in ApiSandbox link to load the query into ApiSandbox, similar to T89229: API Help should generate [try in ApiSandbox] link to Special:ApiSandbox#action=params from getExamples().

T89229#1223928 probably applies there, too.

Aklapper changed the subtype of this task from "Task" to "Feature Request".