Bmansurov has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/350101 )

Change subject: Improve API response on formatversion=2
......................................................................

Improve API response on formatversion=2

The API returns an array (as opposed to an object) of pages when
the `formatversion=2` query parameter is passed. The change should
be non-breaking (at least for WMF API consumers) as I've ran a query
to count the number of API requests to the WMF servers from the beginning
of 2016 till today that use `formatversion=2` and found that there
are 0 such requests. Here is the Hive query:

SELECT COUNT(action) FROM bd808.action_param_hourly WHERE year > 2015
        AND action='templatedata' AND param='formatversion' AND value='2';

The patch also slightly changes the XML response format. This again
is not a breaking change as I've run a similary query to the one
described above for XML responses which resulted in 0 requests.
Here is the Hive query:

SELECT COUNT(action) FROM bd808.action_param_hourly WHERE year > 2015
        AND action='templatedata' AND param='format' AND value='xml';

Hat-tip to Gergo for helping me with this task.

Bug: T155164
Change-Id: I004ca66aa5ee36f78af118967efd0f0a05054990
---
M api/ApiTemplateData.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TemplateData 
refs/changes/01/350101/1

diff --git a/api/ApiTemplateData.php b/api/ApiTemplateData.php
index d66ae1f..d518a27 100644
--- a/api/ApiTemplateData.php
+++ b/api/ApiTemplateData.php
@@ -104,7 +104,7 @@
                        ] + (array) $data;
                }
 
-               ApiResult::setArrayType( $resp, 'kvp', 'id' );
+               ApiResult::setArrayType( $resp, 'BCarray', 'id' );
                ApiResult::setIndexedTagName( $resp, 'page' );
 
                // Set top level element

-- 
To view, visit https://gerrit.wikimedia.org/r/350101
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I004ca66aa5ee36f78af118967efd0f0a05054990
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TemplateData
Gerrit-Branch: master
Gerrit-Owner: Bmansurov <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to