You are here: Home » NewsFeeds » A JSON design problem

A JSON design problem

I did implement a JSON version of XML-RPC as part of the package, and it works really nicely, but has at least one major undecided feature. I’m asking that people who think about JSON give this some thought, and perhaps suggest prior art to look at.
The problem: representing certain types.
These XML-RPC types are not a problem because JSON understands them. When it sees one of these in a JSON file, JSON.parse will create a property or object with the correct type.
However these two types are problematic because there is no way to communicate through JSON that we’re looking at a value of this type.
What happens in the current implementation? The value is converted to and transmitted as a string. You can test it by running the betty test app locally and calling examples.echoParams using the debugger. Here’s a screen shot showing a setup for testing base64


Original article