Closed GoogleCodeExporter closed 8 years ago
Yes, FB just outputs "true". Is that ridiculous? Yeah, I think so. This is
one of the least ugly not-really-JSON responses that FB returns, believe it or
not...there are some pretty gross workarounds in RestFB to handle these kinds
of situations.
Anyway, can you give this a try and see if it works? There should be a special
case in DefaultJsonMapper that correctly handles the invalid "true" situation
when you map it to a Boolean.
client.publish(fbId + "/likes", Boolean.class);
If it works for you, let me know and I'll close this ticket out. Thanks.
Original comment by mark.a.a...@gmail.com
on 23 Feb 2011 at 3:14
I'm not exactly a JSON expert, but I don't think it's so wrong to return
"true". If a dynamic language was the client, it would simply need to check if
(result). But anyway, I tried with Boolean.class and it worked.
Original comment by bozhidar...@gmail.com
on 23 Feb 2011 at 5:10
It's wrong as in it's not JSON by definition, which must be an object or array.
I totally get that this makes things simpler if you're using JS etc. to access
the API, but it is inconsistent. "Some of our API methods will return JSON,
some of them will return random non-JSON strings".
Regardless of all this pedantry, I'm glad your situation has been resolved.
Closing this out...
Original comment by mark.a.a...@gmail.com
on 23 Feb 2011 at 5:27
Original issue reported on code.google.com by
bozhidar...@gmail.com
on 22 Feb 2011 at 11:15