Git Product home page Git Product logo

swagger-petstore's Introduction

Swagger Petstore Sample

Overview

This is the pet store sample hosted at https://petstore3.swagger.io. For other versions, check the branches. We welcome suggestion both the code and the API design. To make changes to the design itself, take a look at https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml.

This is a java project to build a stand-alone server which implements the OpenAPI 3 Spec. You can find out more about both the spec and the framework at http://swagger.io.

This sample is based on swagger-inflector, and provides an example of swagger / OpenAPI 3 petstore.

To run (with Maven)

To run the server, run this task:

mvn package jetty:run

This will start Jetty embedded on port 8080.

To run (via Docker)

Expose port 8080 from the image and access petstore via the exposed port. You can then add and delete pets as you see fit.

Example:

docker build -t swaggerapi/petstore3:unstable .
docker pull swaggerapi/petstore3:unstable
docker run  --name swaggerapi-petstore3 -d -p 8080:8080 swaggerapi/petstore3:unstable

Testing the server

Once started, you can navigate to http://localhost:8080/api/v3/openapi.json 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 bundled in this sample--you can view it it at http://localhost:8080. This lets you inspect the API using an interactive UI. You can access the source of this code from here

swagger-petstore's People

Contributors

frantuma avatar webron 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.