Giter Site home page Giter Site logo

openapi-rest-test's Introduction

open-rest-rest

Minimal examples to use swagger/openapi spec standalone for accessing the swagger petstore.

  • swagger-ui via swagger-ui-dest
  • swagger-ui via swagger-ui-express
  • Test client using swagger-client
  • Spec validation via sway
  • Also include dredd (but found that mysterious)

Usage

This is a node project consisting of

  • the Swagger UI
  • a general-purpose proxy to circumvent CORS problems

The proxy is suited for http and https rest services.

By default, the following paths/endpoints are used

Help

Try

 ./node_modules/.bin/ts-node swagger-ui-dist.ts -h

to get basic help.

Example

Say you want to proxy a jhipster microservice but you have to edit its openapi spec before using.

Let's assume Springdoc Openapi will serve the spec at http://localhost:8083/v3/api-docs You could download this URL as api-docs.json and adapt it to your needs.

After that, point your browser to http://localhost:3000/ui/ to access the Swagger UI. You can see a input text field to type the URL of the API to use in at the very top the UI.

In this field you can now fill in http://localhost:3000/ui/static/api-docs.json and click the 'Explore' button.

Of course, if there is no need to edit the spec, you could directly use http://localhost:3000/v3/api-docs here. (But http://localhost:8083/v3/api-docs would not work because of CORS.)

openapi-rest-test's People

Contributors

aanno2 avatar

Watchers

 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.