Has there been a tweak in how JSON - particularly null values - are handled?
In the API that my iOS project talks to, a field may be blank, or not present; in the returned data from the server, it's usually present, but may have the value set to null, (not quoted) in the JSON, rather than an empty string. For reasons I haven't dug into too much, if a null value was then posted back via the B4i app, it would be converted to a string value of "null" somewhere along the way.
That was straightforward enough to work around, and I thought I'd fixed everything up, then I recompiled the app with v5, and a bug related to null values reappeared. It seems that now, a null value in JSON will be converted to the string value "<null>"
Am I right that that's changed? Certainly tweaking my code to treat both "null" and "<null>" the same has fixed the problem. I guess it's a small change, but if you're flinging JSON around a lot, it could cause odd behaviour.
In the API that my iOS project talks to, a field may be blank, or not present; in the returned data from the server, it's usually present, but may have the value set to null, (not quoted) in the JSON, rather than an empty string. For reasons I haven't dug into too much, if a null value was then posted back via the B4i app, it would be converted to a string value of "null" somewhere along the way.
That was straightforward enough to work around, and I thought I'd fixed everything up, then I recompiled the app with v5, and a bug related to null values reappeared. It seems that now, a null value in JSON will be converted to the string value "<null>"
Am I right that that's changed? Certainly tweaking my code to treat both "null" and "<null>" the same has fixed the problem. I guess it's a small change, but if you're flinging JSON around a lot, it could cause odd behaviour.