Oisín Hurley's Weblog

old dog, new tricks

Enforce Web API version compatibility with Sinatra filters

leave a comment »

Versioning in APIs is vital if you want to control the lifecycle, rather than it controlling you. If you are using Sinatra to do routing for your Web API, then you can easily stuff all the version compatibility testing into one place – a filter – and not have to propagate it through all your routes. Follow the gist to see the code.

https://gist.github.com/987247

Advertisements

Written by oisinhurley

May 3, 2011 at 12:13 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: