Skip to content
Logan Serman edited this page Jun 4, 2015 · 2 revisions

Let's not use this yet, we need to rethink our versioning strategy.

Consumers should pass their API version using the Accept header:

Accept: "application/json"; version=X

In the Rails app, the current API version is given in a routing DSL. When used, any API version that does not match the given version will result in a 412 Precondition failed response and the consumer should be forced to upgrade.

namespace :api, defaults: { format: 'json' } do
  version 2 do
    resources :posts
    # ...
  end
end
Clone this wiki locally