Giter Site home page Giter Site logo

redoc-tryout's Introduction

Redoc Try-out

This is a stopgap solution to provide the Try-Out feature to Redoc: Redocly/redoc#53

This implementation uses JQuery, standing aside of ReDoc waiting it to be fully loaded, and then arms the buttons with click listener. A separate Ajax call is made to load swagger.json just for the Try-out feature. When a click happens on Try-Out button, a form is generated following swagger.json.

Demo: http://technology.edmunds.com/redoc-tryout/demo.html

How to Run

Clone the project. Open demo.html in the browser. The Try-Out button should show up below each method on right panel. Click on Try-Out to bring up the form. Click Send to make the http request. Note that since this is a bowser Ajax call, your api should respond with the correct CORS header when redoc is deployed in a separate host.

How to Configure

Global variable var defaultHost: by default, the http will take in the .host property in the swagger.json. If the swagger.json doesn't have a .host property, defaultHost will be applied.

Global variable var redocLoadingWaitTime: this value in miliseconds is used for The Try-Out feature to wait for ReDoc to be fully loaded. If your ReDoc loads in 7 seconds, let this value be 8000 miliseonds.

redoc-tryout's People

Contributors

yuhanz 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.