predictionio-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dennis Honders <>
Subject Eventserver: Can't convert JArray
Date Sun, 21 May 2017 19:02:50 GMT
For the following request to the eventserver (json array):

{"event": "cart-transaction", "entityId": "1", "entityType": "user",
"targetEntityId": "12", "targetEntityType": "item"},
{"event": "cart-transaction", "entityId": "1", "entityType": "user",
"targetEntityId": "13", "targetEntityType": "item"},
{"event": "cart-transaction", "entityId": "1", "entityType": "user",
"targetEntityId": "14", "targetEntityType": "item"}

I receive the following error:

{"message":"Can't convert
(entityId,JString(1)), (entityType,JString(user)),
(targetEntityId,JString(12)), (targetEntityType,JString(item)))),
art-transaction)), (entityId,JString(1)), (entityType,JString(user)),
(targetEntityId,JString(13)), (targetEntityType,JString(item)))),
JObject(List((event,JString(cart-transaction)), (entityId,JString(1)),
user)), (targetEntityId,JString(14)), (targetEntityType,JString(item))))))
to class"}

The following data object succeeds (single json object):

{"event": "$set", "entityType": "item", "entityId": "1", "properties":
{"category": ["1", "2", "3", "4", "5", "6", "7"], "manufacturer": 1,
"label": "test", "price": "$1-$2"}}

I have a python script to import the data. I both use the same script to
import both. Only passing other value to the parameter.

def make_request(data):
    data = json.dumps(data)
    headers = {'content-type': 'application/json'}

    r =, data=data, headers=headers)

What could be the problem?

View raw message