简体   繁体   中英

JSON timestamp wrong on FIWARE Orion Context Broker global instance

I am sending a POST request to http://orion.lab.fiware.org:1026/v2/entities/85/attrs?type=UrbansenseLocation in order to update atime and bundle attributes:

{
"atime":{
    "type":"Number",
    "value":1476370651},
"bundle":{
    "type":"Number",
    "value":1}
}

and a GET request to the same entity receives the following response:

{
"id": "85",
"type": "UrbansenseLocation",
"atime": {
    "type": "Number",
    "value": 1476370000,
    "metadata": {}
},
"bundle": {
    "type": "Number",
    "value": 1,
    "metadata": {}
},
//some other attributes
}

Please, note the mismatch on the value field of the atime attribute!!! Why is such thing happening?

Thanks.

I understand that atime is meant to be a datetime. In that case, I'd suggest to use the DateTime attribute type. This would provide a better semantic for the attribute and should avoid any number rending problem (as the ones that are being discussed right now at github ).

More information about the DateTime type at the NGSIv2 specification (section "Special Attribute Types") and this document (look for the "Datetime support" slide).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM