DHH on Hypermedia Hype

December 20, 2012 📬 Get My Weekly Newsletter

The ever-opinionated DHH, on the “hype” about “hypermedia” APIs:

The recurrent hoopla over hypermedia APIs is completely overblown. Embedding URLs instead of IDs is not going to guard you from breakage, it’s not going to do anything materially useful for standardizing API clients, and it doesn’t do much for discoverability.

Couldn’t agree more. Just getting developers to consume an API that isn’t all POSTs is hard enough. If “hypermedia” has demonstrable benefits, I certainly have never seen proof of this, outside of a lot of exasperated flailing.

Remember when “Hypermedia APIs” were called REST? I do. From my post about this in 2009:

Rest Compliance Officer: Is there exactly one endpoint, from which any and all resource locators are discoverable?
Me: Um, no, that puts undue burden on the client libraries, and over-complicates what we were trying to accomp….
RCO: YOU ARE NOT RESTFUL! READ FIELDING’S DISSERTATION, THE HTTP SPEC AND IMPLEMENT AN RFC-COMPLIANT URI PARSER IN THREE DIFFERENT LANGUAGES. NEXT!

Using HTTP methods for their intention is great, as is sane URL design, but the fantasy of a generic client that can discover and navigate every possible operation of a web UI seems like just that…fantasy.