| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303 |
- {
- "openapi": "3.0.0",
- "info": {
- "title": "Swagger Petstore",
- "description": "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification",
- "termsOfService": "http://swagger.io/terms/",
- "contact": {
- "name": "Swagger API Team"
- },
- "license": {
- "name": "MIT"
- },
- "version": "1.0.0"
- },
- "servers": [
- {
- "url": "petstore.swagger.io",
- "description": "API server"
- }
- ],
- "paths": {
- "/pets": {
- "get": {
- "description": "Returns all pets from the system that the user has access to",
- "operationId": "findPets",
- "parameters": [
- {
- "name": "tags",
- "in": "query",
- "description": "tags to filter by",
- "required": false,
- "style": "form",
- "schema": {
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- },
- {
- "name": "limit",
- "in": "query",
- "description": "maximum number of results to return",
- "required": false,
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "pet response",
- "content": {
- "application/xml": {
- "schema": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Pet"
- }
- }
- },
- "text/xml": {
- "schema": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Pet"
- }
- }
- },
- "text/html": {
- "schema": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Pet"
- }
- }
- },
- "application/json": {
- "schema": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Pet"
- }
- }
- }
- }
- },
- "default": {
- "description": "unexpected error",
- "content": {
- "application/xml": {
- "schema": {
- "$ref": "#/components/schemas/ErrorModel"
- }
- },
- "text/xml": {
- "schema": {
- "$ref": "#/components/schemas/ErrorModel"
- }
- },
- "text/html": {
- "schema": {
- "$ref": "#/components/schemas/ErrorModel"
- }
- },
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ErrorModel"
- }
- }
- }
- }
- }
- },
- "post": {
- "description": "Creates a new pet in the store. Duplicates are allowed",
- "operationId": "addPet",
- "requestBody": {
- "description": "Pet to add to the store",
- "required": true,
- "content": {
- "multipart/form-data": {
- "schema": {
- "$ref": "#/components/schemas/NewPet"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "pet response",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Pet"
- }
- }
- }
- },
- "default": {
- "description": "unexpected error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ErrorModel"
- }
- }
- }
- }
- }
- }
- },
- "/pets/{id}": {
- "get": {
- "description": "Returns a user based on a single ID, if the user does not have access to the pet",
- "operationId": "findPetById",
- "parameters": [
- {
- "name": "id",
- "in": "path",
- "description": "ID of pet to fetch",
- "required": true,
- "schema": {
- "type": "integer",
- "format": "int64"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "pet response",
- "content": {
- "application/xml": {
- "schema": {
- "$ref": "#/components/schemas/Pet"
- }
- },
- "text/xml": {
- "schema": {
- "$ref": "#/components/schemas/Pet"
- }
- },
- "text/html": {
- "schema": {
- "$ref": "#/components/schemas/Pet"
- }
- },
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Pet"
- }
- }
- }
- },
- "default": {
- "description": "unexpected error",
- "content": {
- "application/xml": {
- "schema": {
- "$ref": "#/components/schemas/ErrorModel"
- }
- },
- "text/xml": {
- "schema": {
- "$ref": "#/components/schemas/ErrorModel"
- }
- },
- "text/html": {
- "schema": {
- "$ref": "#/components/schemas/ErrorModel"
- }
- },
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ErrorModel"
- }
- }
- }
- }
- }
- },
- "delete": {
- "description": "deletes a single pet based on the ID supplied",
- "operationId": "deletePet",
- "parameters": [
- {
- "name": "id",
- "in": "path",
- "description": "ID of pet to delete",
- "required": true,
- "schema": {
- "type": "integer",
- "format": "int64"
- }
- }
- ],
- "responses": {
- "204": {
- "description": "pet deleted"
- },
- "default": {
- "description": "unexpected error"
- }
- }
- }
- }
- },
- "components": {
- "schemas": {
- "NewPet": {
- "required": [
- "name"
- ],
- "properties": {
- "name": {
- "type": "string"
- },
- "tag": {
- "type": "string"
- }
- },
- "type": "object"
- },
- "Pet": {
- "type": "object",
- "allOf": [
- {
- "$ref": "#/components/schemas/NewPet"
- },
- {
- "required": [
- "id"
- ],
- "properties": {
- "id": {
- "type": "integer",
- "format": "int64"
- }
- },
- "type": "object"
- }
- ]
- },
- "ErrorModel": {
- "required": [
- "code",
- "message"
- ],
- "properties": {
- "code": {
- "type": "integer",
- "format": "int32"
- },
- "message": {
- "type": "string"
- }
- },
- "type": "object"
- }
- }
- }
- }
|