Last modified: 2014-11-07 13:10:59 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T74947, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 72947 - Make parse errors in wbparsevalue have the same structure as normal api errors
Make parse errors in wbparsevalue have the same structure as normal api errors
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
WikidataRepo (Other open bugs)
master
All All
: Low normal (vote)
: ---
Assigned To: Wikidata bugs
u=dev c=backend p=0
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-11-04 11:52 UTC by Adrian Lang
Modified: 2014-11-07 13:10 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Adrian Lang 2014-11-04 11:52:38 UTC
wbparsevalue returns an array of results, each possibly representing an error. The format looks like this:

{
    "results": [
        {
            "raw": "VALUE",
            "error": "ValueParsers\\ParseException",
            "error-info": "The provided id serialization \"VALUE\" is not valid",
            "expected-format": "entity-id",
            "messages": [
                {
                    "name": "wikibase-parse-error-entity-id",
                    "parameters": [],
                    "html": {
                        "*": "The entity id is malformed."
                    }
                }
            ]
        }
    ]
}

Convention would suggest the following format:

{
    "results": [
        {
            "raw": "VALUE",
            "error": {
                "code": "wikibase-parse-error"
                "info": "The provided id serialization \"VALUE\" is not valid"
                "messages": [
                    {
                        "name": "wikibase-parse-error-entity-id",
                        "parameters": [],
                        "html": {
                            "*": "The entity id is malformed."
                        }
                    }
                ]
            }
        }
    ]
}

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links