From 702ff66de42a6bec69aea5df6315ef7ff34a654d Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Wed, 23 Jan 2008 16:59:37 +0000 Subject: [PATCH] API: Adding parameter description to action=paraminfo output --- includes/api/ApiParamInfo.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/api/ApiParamInfo.php b/includes/api/ApiParamInfo.php index cc527023d1..eb89ec5123 100644 --- a/includes/api/ApiParamInfo.php +++ b/includes/api/ApiParamInfo.php @@ -78,6 +78,7 @@ class ApiParamInfo extends ApiBase { if(!is_array($allowedParams)) return $retval; $retval['parameters'] = array(); + $paramDesc = $obj->getParamDescription(); foreach($obj->getAllowedParams() as $n => $p) { $a = array('name' => $n); @@ -111,6 +112,8 @@ class ApiParamInfo extends ApiBase { $a['highmax'] = $p[ApiBase::PARAM_MAX2]; if(isset($p[ApiBase::PARAM_MIN])) $a['min'] = $p[ApiBase::PARAM_MIN]; + if(isset($paramDesc[$n])) + $a['description'] = (is_array($paramDesc[$n]) ? implode("\n", $paramDesc[$n]) : $paramDesc[$n]); $retval['parameters'][] = $a; } $result->setIndexedTagName($retval['parameters'], 'param'); -- 2.20.1