Page MenuHomePhabricator

API action=wbgetentities does not handle formatversion=2
Open, Needs TriagePublic

Description

Both of this requests return identical result, ignoring JSON v2:

{
    "entities": {
        "-1": {
            "site": "enwiki",
            "title": "Bug12345",
            "missing": ""
        }
    },
    "success": 1
}

expected for v2:

{
    "entities": [
        {
            "site": "enwiki",
            "title": "Bug12345",
            "missing": true
        }
    ],
    "success": true
}

Event Timeline

Yurik created this task.Dec 16 2018, 4:36 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 16 2018, 4:36 AM
Yurik updated the task description. (Show Details)Dec 16 2018, 4:37 AM

Relevant code for this specific example: https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Wikibase/+/6eea7f8d5e52a528877748391e3fae965f752018/repo/includes/Api/ResultBuilder.php#1019. Changing that "" to true should do it, although with how complicated Wikibase's code is I can't say for sure.

There may, of course, be other places in the code with the same or similar issues.