Integrates swagger-ui with rails asset pipeline
Switch branches/tags
Clone or download
Latest commit a74f04b Mar 15, 2017
Type Name Latest commit message Commit time
Failed to load latest commit information.
app Fix url protocol in search placeholder Sep 5, 2016
config init Feb 25, 2013
lib bump version (reflecting lib version) Mar 15, 2017
vendor/assets swagger-ui update 2.2.8 Mar 15, 2017
.gitignore support swagger spec 2.0 May 23, 2016 grape swagger ui update Mar 15, 2017
Gemfile init Feb 25, 2013
LICENSE.txt init Feb 25, 2013 slim added Jan 24, 2017
Rakefile init Feb 25, 2013
grape-swagger-ui.gemspec haml dep removed Jan 14, 2015


Code Climate

TODO/WIP: Write a gem description

Integrates swagger-ui with your "grapified" Rails application.


Add swagger compliant documentation to your grape API

An opinionated micro-framework for creating REST-like APIs in Ruby


Add this line to your application's Gemfile:

gem 'grape-swagger-ui'

And then execute:

$ bundle

Or install it yourself as:

$ gem install grape-swagger-ui

Usage example:

class YourAPI < Grape::API
  version 'v1'
  format :json
  add_swagger_documentation :add_version => true,
                            :base_path => '/api'

See for more configuration settings.

If your api path is "api/v1" just go to



Generate the main layout for customizations

rails generate swagger:layout [TEMPLATE_ENGINE]

and change the initializer. Currently supported: ERB, HAML, SLIM.

Since this is a seperate layout and if you want to use this in your staging environment you need to precompile it.

config.assets.precompile += %w(swagger_ui.js swagger_ui.css swagger_ui_print.css swagger_ui_screen.css)


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request


MIT License, full text of license see here

Free Software, Fuck Yeah!