Page MenuHomePhabricator

Show “internal” API module help flag in Special:ApiSandbox
Closed, ResolvedPublic

Description

As far as I can tell, the “internal” flag isn’t shown anywhere on the API Sandbox, which means that people who explore the API through the sandbox instead of via action=help don’t see the warning that a module is internal or unstable.

Details

Related Gerrit Patches:

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 22 2018, 4:53 PM
Anomie moved this task from Unsorted to Needs Code on the MediaWiki-API board.Jan 23 2018, 1:22 PM

Unless someone has a better suggestion, I’d display internal modules similar to deprecated ones: ordered at the end of the module list, strikethrough on the label, and with a bold red notice before the summary message. (If we’re feeling adventurous, make the notice yellow instead of red?)

The API sandbox doesn’t currently display anything special on the page for the module itself, as far as I can tell; informing developers that this is a deprecated module is left to the module itself, via the apihelp-NAME-extended-description message. We can keep it this way for internal modules, too.

Restricted Application added a project: Core Platform Team. · View Herald TranscriptOct 10 2019, 2:10 PM
Lucas_Werkmeister_WMDE renamed this task from Show “internal” and other API module help flags in Special:ApiSandbox to Show “internal” API module help flag in Special:ApiSandbox.Oct 10 2019, 2:23 PM
Anomie added a subscriber: Anomie.

Unless someone has a better suggestion, I’d display internal modules similar to deprecated ones: ordered at the end of the module list, strikethrough on the label, and with a bold red notice before the summary message.

The 'internal' flag isn't available when building the list. You'd have to adjust the output from action=paraminfo for submodule-type parameters to somehow include it.

I'm not sure that the strikethrough used for deprecated submodules would be appropriate for internal submodules too. Reordering and a red notice saying "Internal" would be fine though.

The API sandbox doesn’t currently display anything special on the page for the module itself, as far as I can tell

I wouldn't oppose adding something there if you want.

The 'internal' flag isn't available when building the list. You'd have to adjust the output from action=paraminfo for submodule-type parameters to somehow include it.

Oh, I didn’t know paraminfo doesn’t include that information. Thanks.

Hm, this is a bit tricky because there’s some correspondence between “this module is deprecated” (make isDeprecated() return true) and “the parameter value specifying this module is deprecated” (ApiBase::PARAM_DEPRECATED), whereas there’s no such thing as internal parameter values. I’m not yet sure if that’s a big problem.

If you want to do anything in JS for it, you'd probably need to add another output array paralleling "deprecatedvalues".

On the other hand, for deprecated submodules the reordering is done in ApiParamInfo and the red "Deprecated" is done in ApiBase::getFinalParamDescription() and ApiHelpParamValueMessage, with no involvement from JS in either one.

Change 542158 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/core@master] Highlight internal modules in API help and sandbox

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

Yeah, I noticed while working on the above patch how little this actually has to do with the API sandbox itself :)

Change 542158 merged by jenkins-bot:
[mediawiki/core@master] Highlight internal modules in API help and sandbox

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