I have been experimenting with Orion for the past few days, and after a while I did it as planned.
I came across unexpected annoyance, although the string attribute for the given entity context will not be able to register.
Example:
http POST [my_orion_server_url]:1026/v1/updateContext < create_push.json
Where create_push.json:
{
"contextElements": [
{
"type": "Push",
"isPattern": "false",
"id": "Push1",
"attributes": [
{
"name": "message",
"type": "string",
"value": "this is a test)"
}
]
}
],
"updateAction": "APPEND"
}
The server responds:
HTTP/1.1 200 OK
Content-Length: 129
Content-Type: application/json
Date: Thu, 19 Nov 2015 11:47:03 GMT
{
"errorCode": {
"code": "400",
"details": "Illegal value for JSON field",
"reasonPhrase": "Bad Request"
}
}
If, on the other hand, I remove the brackets, everything works as expected:
Json file:
{
"contextElements": [
{
"type": "Push",
"isPattern": "false",
"id": "Push1",
"attributes": [
{
"name": "message",
"type": "string",
"value": "this is a test"
}
]
}
],
"updateAction": "APPEND"
}
Server response:
{
"contextResponses": [
{
"contextElement": {
"attributes": [
{
"name": "message",
"type": "string",
"value": ""
}
],
"id": "Push1",
"isPattern": "false",
"type": "Push"
},
"statusCode": {
"code": "200",
"reasonPhrase": "OK"
}
}
]
}
Is this scheduled or a mistake?
I can overcome the problem encoding brackets with something else, and then decode on reception, but the ability to send brackets directly with the entity will be smoother and less annoying.