Hello all,
I am using GSON to deserialize the json output from
sen.se into a Java
Object. I am facing a small problem.
I normally get the following reply:
[
{
"publish_id": "51F407EAE91F7",
"value": 117,
"timetag": "2011-07-21T16:02:50.949493+00:00",
"feed_id": 3318,
"id": 23174927,
"unit": "°C"
}
]
which is not compatible with what GSON is expecting, as GSON needs an
identifier for the array and all objects in question, so something
like this:
{
"senseReply": {
"feedList": [
"feedInfo":
{
"publish_id": "51F407EAE91F7",
"value": 117,
"timetag": "2011-07-21T16:02:50.949493+00:00",
"feed_id": 3318,
"id": 23174927,
"unit": "°C"
}
]
}
}
would be needed to be compatible with Java Object-json mappers.
I don't know if I am doing something wrong, but my feeling is that the
API response format is not too compatible with json-object mappings
tools like GSON or so. It's hard to use (for the purposes of my
application) the platform without the ability to automate the
serialization and deserialization of the feeds (i.e. I cannot do it by
hand with the low-level parsers)
If anyone has any ideas, it would be great to hear your opinion on the
matter.
Best regards,
David