This is an example of establishing API versioning on top of an existing, unversioned Rails API.
-
Clone the repo
$ git clone git@github.com:iamvery/rails-api-example.git $ cd rails-api-example
-
Install dependencies
$ bundle install
-
Watch the specs pass
$ bin/rspec ... 0 failures
The initial, unversioned implementation is at https://github.com/iamvery/rails-api-example/tree/initial-api-implementation. From there the commits incrementally add versioning to the API using HTTP accept headers with a vendor internet media type.
There are few suite spots in this repo (see what I did there?)