GithubHelp home page GithubHelp logo

rails-petstore's Introduction

Swagger Sample App

Overview

This is a rails project to build a stand-alone server which implements the Swagger spec. You can find out more about both the spec and the framework at http://swagger.io. There is an online version of this server at http://petstore.swagger.io/api/api-docs

This project is using a fork of grape-swagger, generously written by Tim Vandecasteele. Once the changes to make it swagger-1.2 compatible are merged, the project will be updated to use that. Also many thanks to Kyle Ginavan and Craig Cottingham for putting this sample together, and updating the grape-swagger gem.

To run

To run the server, run this task:

bundle update
rake db:migrate
rails s

Note if you have trouble with bundle update, please make sure you have postgres installed--rails is expecting it, even though it's not using the database at all.

This will start rails on port 3000.

Testing the server

Once started, you can navigate to http://localhost:3000/api/api-docs to view the Swagger Resource Listing. This tells you that the server is up and ready to demonstrate Swagger.

Using the UI

There is an HTML5-based API tool available in a separate project. This lets you inspect the API using an intuitive UI. You can pull this code from here: https://github.com/swagger-api/swagger-ui

You can then open the dist/index.html file in any HTML5-enabled browser. Upen opening, enter the URL of your server in the top-centered input box. Click the "Explore" button and you should see the resources available on the server.

rails-petstore's People

Contributors

fehguy avatar kylejginavan avatar krisalyssa avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.