Topic on Talk:Wikibase/API

Deserializers\\Exceptions\\MissingTypeException?

2
SixTwoEightBot (talkcontribs)

I'm trying to use wbsetclaim. However, I always get this error:

{"error":{"code":"internal_api_error_Deserializers\\Exceptions\\MissingTypeException","info":"[XAG4RQpAEDcAADvq7GUAAAAR] Caught exception of type Deserializers\\Exceptions\\MissingTypeException"},"servedby":"mw1290"}

My claim is:

 {
   "id": "Q4115189$ffa51229-4877-3135-a2e2-a22fe9b7039d",
   "snaktype":"value",
   "property":"p1",
   "datavalue":  {
     "value":"bot test",
     "type":"string"
   }
 }

Valerio Bozzolan (talkcontribs)

Hello! AFAIK you are missing the DataType. Here you are an example:

"snaktype": "value",
"property": "P1",
"datavalue": {
    "value": "bot test",
    "type": "string"
 },
 "datatype": "string"

Actually this is described in the Wikibase/DataModel/JSON#Snaks page but you can also look at existing claims with the wbgetentities API query.

Reply to "Deserializers\\Exceptions\\MissingTypeException?"