Improve API parameter documentation

These messages are used on Special:ApiSandbox.

Change-Id: I07809d3f9402d30c5d2d364e0634bd020f86f64f
This commit is contained in:
Bartosz Dziewoński 2021-02-11 00:05:38 +01:00
parent 1998c983f1
commit 03f22c538e
4 changed files with 15 additions and 6 deletions

View file

@ -3,10 +3,14 @@
"authors": []
},
"apierror-discussiontools-commentid-notfound": "Comment ID not found: $1",
"apihelp-discussiontools-param-oldid": "The revision number to use (defaults to latest revision).",
"apihelp-discussiontools-summary": "Returns metadata required to initialize the discussion tools.",
"apihelp-discussiontools-paramvalue-paction-transcludedfrom": "Return titles of pages from which each comment on the given page is transcluded.",
"apihelp-discussiontools-param-oldid": "The revision number to use (defaults to latest revision).",
"apihelp-discussiontoolsedit-summary": "Post a message on a discussion page.",
"apihelp-discussiontoolsedit-param-commentid": "Comment ID.",
"apihelp-discussiontoolsedit-param-html": "HTML",
"apihelp-discussiontoolsedit-param-wikitext": "Wikitext"
"apihelp-discussiontoolsedit-paramvalue-paction-addcomment": "Add a new comment as a reply to an existing comment.",
"apihelp-discussiontoolsedit-paramvalue-paction-addtopic": "Add a new discussion section and the first comment in it.",
"apihelp-discussiontoolsedit-param-commentid": "Comment ID to reply to. Only used when <var>paction</var> is <var>addcomment</var>.",
"apihelp-discussiontoolsedit-param-sectiontitle": "{{int:apihelp-edit-param-sectiontitle}} Only used when <var>paction</var> is <var>addtopic</var>.",
"apihelp-discussiontoolsedit-param-html": "Content to post, as HTML. Cannot be used together with <var>wikitext</var>.",
"apihelp-discussiontoolsedit-param-wikitext": "Content to post, as wikitext. Cannot be used together with <var>html</var>."
}

View file

@ -5,10 +5,14 @@
]
},
"apierror-discussiontools-commentid-notfound": "{{doc-apierror}}\n\nParameters:\n* $1 - Comment ID",
"apihelp-discussiontools-param-oldid": "{{doc-apihelp-param|discussiontools|oldid}}",
"apihelp-discussiontools-summary": "{{doc-apihelp-summary|discussiontools}}",
"apihelp-discussiontools-paramvalue-paction-transcludedfrom": "{{doc-apihelp-paramvalue|discussiontools|paction|transcludedfrom}}",
"apihelp-discussiontools-param-oldid": "{{doc-apihelp-param|discussiontools|oldid}}",
"apihelp-discussiontoolsedit-summary": "{{doc-apihelp-summary|discussiontoolsedit}}",
"apihelp-discussiontoolsedit-paramvalue-paction-addcomment": "{{doc-apihelp-paramvalue|discussiontoolsedit|paction|addcomment}}",
"apihelp-discussiontoolsedit-paramvalue-paction-addtopic": "{{doc-apihelp-paramvalue|discussiontoolsedit|paction|addtopic}}",
"apihelp-discussiontoolsedit-param-commentid": "{{doc-apihelp-param|discussiontoolsedit|commentid}}",
"apihelp-discussiontoolsedit-param-sectiontitle": "{{doc-apihelp-param|discussiontoolsedit|sectiontitle}}",
"apihelp-discussiontoolsedit-param-html": "{{optional}}\n{{doc-apihelp-param|discussiontoolsedit|html}}",
"apihelp-discussiontoolsedit-param-wikitext": "{{doc-apihelp-param|discussiontoolsedit|wikitext}}"
}

View file

@ -77,6 +77,7 @@ class ApiDiscussionTools extends ApiBase {
'transcludedfrom',
],
ApiBase::PARAM_HELP_MSG => 'apihelp-visualeditoredit-param-paction',
ApiBase::PARAM_HELP_MSG_PER_VALUE => [],
],
'page' => [
ParamValidator::PARAM_REQUIRED => true,

View file

@ -224,6 +224,7 @@ class ApiDiscussionToolsEdit extends ApiBase {
'addtopic',
],
ApiBase::PARAM_HELP_MSG => 'apihelp-visualeditoredit-param-paction',
ApiBase::PARAM_HELP_MSG_PER_VALUE => [],
],
'page' => [
ParamValidator::PARAM_REQUIRED => true,
@ -248,7 +249,6 @@ class ApiDiscussionToolsEdit extends ApiBase {
],
'sectiontitle' => [
ParamValidator::PARAM_TYPE => 'string',
ApiBase::PARAM_HELP_MSG => 'apihelp-edit-param-sectiontitle',
],
'watchlist' => [
ApiBase::PARAM_HELP_MSG => 'apihelp-edit-param-watchlist',