Stack Exchange API V2.0: The Stable FuturePosted: 2012/02/22
This is the last of my planned series about v2.0 of the Stack Exchange API (the contest is still going on, and we froze the interface a few weeks ago), and I’d like to talk about some regrets. Not another mistakes post (API V2.0 is still too young to judge with the benefit of hindsight), but something in a similar vein.
This is thankfully a pretty short post, as I’ve worked pretty hard to reduce the regrettable things in every iteration of our API.
The need for breaking changes
I definitely tried to break as little as possible, compare the question object in V1.1 to that in V2.0 to see how little changed. However, we ate two big breaks: restructuring the common response wrapper, and moving the API from per-site urls (api.stackoverflow.com, api.serverfault.com, etc.) to a single shared domain (api.stackexchange.com).
These were definitely needed, and I’m certain benefits they give us will quickly pay off the transition pain; but still, breaking changes impose work on consumers. When building an API it’s important to never make breaking changes wantonly, you’re making non-trivial imposition on other developer’s time.
We couldn’t do everything
I’ve already got a list of things I want in V2.1, unfortunately some of them were things I’d like to have gotten into V2.0. A truism of development is that there’s always more to be done, real developers ship, and so on. API development is no different, but I’m hoping to see an increase in new features and a decrease in time between API revisions as Stack Exchange matures.
We should be much stabler now
Naturally, since I’m aware of these problems we’ve taken steps to make them less of an issue.
I’m very satisfied with the current request wrapper, and the filter feature (plus our backwards compatibility tooling around it) makes it much easier to make additions to it without breaking existing consumers. In general, filters allow for lots of forward compatibility guarantees.
We’ll never be able to do everything, but all sorts of internal gotchas that made V1.1 really rough to roll out have been fixed as part of V2.0. Subsequent minor revisions to V2.0 shouldn’t be nearly as rough, and with our growing staff developer resources should be comparatively plentiful.