https://bugzilla.wikimedia.org/show_bug.cgi?id=72947

            Bug ID: 72947
           Summary: Make parse errors in wbparsevalue have the same
                    structure as normal api errors
           Product: MediaWiki extensions
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: WikidataRepo
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
       Web browser: ---
   Mobile Platform: ---

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."
                        }
                    }
                ]
            }
        }
    ]
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to