RESTful JSON is a pretty good (and obvious) idea. I’ve noodled on it before. Joe has too. One thing I don’t like about Joe’s post is that it implies there’s a difference between documents and data. It’s an arbitrary distinction lacking a technical basis. It is, perhaps unintentionally, a way to apologize for Atom, the format and the protocol. Atom turned out to be a pretty good syndication format. The protocol spec is pretty good too, before you focus on the data being passed around. It turns out the pretty good syndication format is a sucky thing to author with, even though the authoring protocol is pretty good. This happened because the WG wrote the specs in the wrong order. The proposed JSON stuff tries to do so much less. No namespaces, required fields, yadda, yadda. You can Solve Any Problem… …if you’re willing to make the problem small enough.

I’ve also come to the conclusion that RESTful JSON is a dead-end, but it might be useful in the short term. This characterization is not an insult–it describes most of the protocols we use today. You can start to see it break apart at the seams, though. Those of you that have actually read the REST thesis know that one of HTTP’s unRESTful properties is the failure of HTTP headers to separate control data from representation metadata. Joe’s proposal stuffs it into the message body too, just like WebDAV, albeit with GET request. Oh, lordy. And what happens if you request one of those collection JSON documents and it contains metadata that conflicts with the HTTP headers? And isn’t this JSON collection document really a way to tunnel interleaved metadata and unsolicited responses (server push) through HTTP?

Spin your beenies and try to remember that college course on architecture astronautics. What we have here is the duct tape chewing gum scotch tape Waka protocol. Ah, sweet, vaporous Waka.

It will be interesting to see whether these RESTful JSON proposals end up getting really complicated by their interaction with HTTP. I firmly believe it might not matter.

Leave a Reply