GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - spier/plastic-api: Plastic API is a boilerplate for building API mockups with grape and swagger

BranchesTags
Open more actions menu

Latest commit

 

History

17 Commits
17 Commits

Folders and files

NameName
Last commit message
Last commit date
apis
apis
 
 
public
public
 
 
Gemfile
Gemfile
 
 
Gemfile.lock
Gemfile.lock
 
 
README.md
README.md
 
 
Rakefile
Rakefile
 
 
config.ru
config.ru
 
 

Repository files navigation

Plastic API

Plastic API is a boilerplate for building API mockups with ruby, using grape and OpenAPI Specification (aka swagger specs).

The easiest way to host an API mockup based on this, is on heroku.

How to run this

Tested with ruby-2.3

bundle install
rackup
open http://localhost:9292

Why?

I frequently discuss required modifications to APIs with various teams. Often the easiest way to agree on the requirements for an API, is to write a mockup that defines request and response formats. The mockup data returned by such an API can be as realistic as you need it to be.

It took a while to get this stack (below) to work, as there are various compatibility issues. As I did not want to run into this problem every time I create a mock, I created this boilerplate repo.

That being said, be careful when you upgrade either of the components of the stack!

Deploying to heroku

See a sample deployment at https://plastic-api.herokuapp.com

Deploying to heroku is explained at https://devcenter.heroku.com/articles/git.

Create the app

heroku create

Then deploy new version with

git push heroku master

Stack

This projects is a working example of a combination of

  • grape (0.19.2) - DSL for API generation
  • grape-swagger (0.27.0) - generating Swagger Spec for a grape API (generates Swagger Spec v2.0)
  • swagger-ui (2.1.5) - turns swagger.json specs into a nice interactive API console that runs in the browser

Similar projects

https://github.com/ruby-grape/grape-on-rack has the same Stack but doesn't not include the swagger-ui. Also contains some good examples of how to build APIs with grape.

TODO

  • upgrade to latest swagger-ui / at time of writing 2.2.10
  • remove gems that are not needed
  • provide some better sample APIs
  • explain what can be done with rake (i.e. Show all API paths in the console)
  • add localization for 'de' to swagger-ui (what is this good for?)

License

MIT License (MIT)

About

Plastic API is a boilerplate for building API mockups with grape and swagger

Resources

Readme
Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.