xapi not accepted
Sending simple json statements via a post to /learning-record-store/resources/statements now works... E.g. POST /learning-record-store/resources/statements HTTP/1.1 Authorization: Basic PFRlc3QgVXNlcj46PFRlc3QgUGFzc3dvcmQ+ X-Experience-API-Version: 1.0.2 Content-Type: application/json Connection: keep-alive Host: 127.0.0.1 User-Agent: Mozilla/5.0 (Darwin x64) node.js/8.4.0 v8/6.0.286.52 Content-Length: 73
{"id":11,"actor":"stefaan ternier","verb":"write","object":"source code"}
However, when doing an arbitrary statement like the following, mapping into XApiStatement fails
POST /learning-record-store/resources/statements HTTP/1.1 Authorization: Basic PFRlc3QgVXNlcj46PFRlc3QgUGFzc3dvcmQ+ X-Experience-API-Version: 1.0.2 Content-Type: application/json Connection: keep-alive Host: 127.0.0.1 User-Agent: Mozilla/5.0 (Darwin x64) node.js/8.4.0 v8/6.0.286.52 Content-Length: 282
{"timestamp":"2018-01-23T14:47:34.298Z","actor":{"objectType":"Agent","mbox":"mailto:info@tincanapi.com"},"verb":{"id":"http://adlnet.gov/expapi/verbs/experienced","display":{"und":"experienced"}},"object":{"id":"http://rusticisoftware.github.com/TinCanJS","objectType":"Activity"}
Access-Control-Allow-Credentials: true Content-Type: text/html;charset=UTF-8 Content-Length: 122 Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS, HEAD Access-Control-Max-Age: 151200
Unrecognized field "timestamp" (class de.dipf.trula.lrs.statement.entity.XApiStatement), not marked as ignorable
I would not map the json of the XApiStatement into a java object, but whould rather threat it as a json object or text string.