Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AlexanderRD/2402e390908a268bc877d8903bbcce1c to your computer and use it in GitHub Desktop.
Save AlexanderRD/2402e390908a268bc877d8903bbcce1c to your computer and use it in GitHub Desktop.
Export Grape API docs to single html file using Swagger and Bootprint
# Ensure swagger docs have been generated for your app,
# by weirdly running your app locally and navigating to route
# that matches whwere the docs are mounted
rails s -p 3001
# Install bootprint
npm install -g bootprint
npm install -g bootprint-openapi
# Use Bootprint to generate docs from the default swagger docs location
bootprint openapi http://petstore.swagger.io/v2/swagger.json TARGET_DIR
# Combine files into a single file
npm -g install html-inline
html-inline TARGET_DIR/index.html > OUTPUT.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment