Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/swagger-api/swagger-petstore
https://github.com/swagger-api/swagger-petstore
open-source openapi openapi3 petstore swagger swagger-oss
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/swagger-api/swagger-petstore
- Owner: swagger-api
- License: apache-2.0
- Created: 2019-09-07T14:54:31.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-24T09:12:47.000Z (2 months ago)
- Last Synced: 2024-10-25T06:28:40.289Z (2 months ago)
- Topics: open-source, openapi, openapi3, petstore, swagger, swagger-oss
- Language: Java
- Homepage: http://petstore.swagger.io
- Size: 4.76 MB
- Stars: 252
- Watchers: 16
- Forks: 359
- Open Issues: 61
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://github.com/swagger-api/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](http://localhost:8080). This lets you inspect the API using an interactive UI. You can access the source of this code from [here](https://github.com/swagger-api/swagger-ui)