Page MenuHomePhabricator

list=watchlistraw does not set the result under "query"
Open, LowPublic

Description

list=watchlistraw adds its result to the api tag and not to query tag like all other query modules (in core). It is possible to change this? That makes a easy design on client site a harder (Each action module adds its result under its module name). Thanks.

Using list=watchlistraw gives

<?xml version="1.0"?>
<api>
  <watchlistraw>
    <wr ns="?" title="?" />
  </watchlistraw>
  <query-continue>
    <watchlistraw wrcontinue="?|?" />
  </query-continue>
</api>

but using (for example) list=watchlist gives

<?xml version="1.0"?>
<api>
  <query>
    <watchlist>
      <item pageid="?" revid="?" old_revid="?" ns="?" title="?" />
    </watchlist>
  </query>
  <query-continue>
    <watchlist wlstart="?" />
  </query-continue>
</api>

Details

Reference
bz34356

Related Objects

StatusSubtypeAssignedTask
OpenFeatureNone
OpenNone

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:11 AM
bzimport set Reference to bz34356.
bzimport added a subscriber: Unknown Object (MLST).

Changing this would be a breaking change... Errrrr

This has been in since October 2008

Your choice. Maybe you can discussion this, with other developers knowing about the api. You can make this as INVALID or WONTFIX, than is this for documentation only. That is ok, but the assumption is another (at least from me, because all other modules handles as that).

maybe add a new parameter (rawwatchlist?) with the correct behavior and mark the current one as deprecated ?

Reopening, it is a valid bug and we can fix it without breaking back compatibility

(In reply to comment #5)

Reopening, it is a valid bug and we can fix it without breaking back
compatibility

How do you propose to do that? The only way I can imagine would be outputting everything twice: once with query and once without, but that doesn't seem like a good solution to me.

BTW, I have proposed this change (currently under review): https://gerrit.wikimedia.org/r/#change,5588

Having a parameter does not make sense, because you have to add things to your framework, that this parameter is always set for that module. In that case you can add things to your framework, which change the position in the result (or get it from the current place). Setting this to wontfix and all is good, because all what you can do, needs extra work in your framework or is a breaking change for other fremeworks.

(In reply to comment #7)

The last version of my patch creates new module rawwatchlist, which correctly has the "query" element and marks the old watchlistraw as deprecated. It's not a great solution, but I can't think of a better one.

Assigning bug to Sam Reed since he is:

  • the API maintainer
  • already reviewing gerrit change 5588
CCicalese_WMF subscribed.

Remove CPT tag automatically added by Herald.