1swagger: '2.0' 2info: 3 version: '1.0.0' 4 title: Swagger Petstore (Simple) 5 description: A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification 6 termsOfService: http://helloreverb.com/terms/ 7 contact: 8 name: Swagger API team 9 email: foo@example.com 10 url: http://swagger.io 11 license: 12 name: MIT 13 url: http://opensource.org/licenses/MIT 14host: petstore.swagger.wordnik.com 15basePath: /api 16schemes: 17 - http 18consumes: 19 - application/json 20produces: 21 - application/json 22paths: 23 /pets: 24 get: 25 description: Returns all pets from the system that the user has access to 26 operationId: findPets 27 produces: 28 - application/json 29 - application/xml 30 - text/xml 31 - text/html 32 parameters: 33 - name: tags 34 in: query 35 description: tags to filter by 36 required: false 37 type: array 38 items: 39 type: string 40 collectionFormat: csv 41 - name: limit 42 in: query 43 description: maximum number of results to return 44 required: false 45 type: integer 46 format: int32 47 responses: 48 '200': 49 description: pet response 50 schema: 51 type: array 52 items: 53 $ref: '#/definitions/pet' 54 default: 55 description: unexpected error 56 schema: 57 $ref: '#/definitions/errorModel' 58 post: 59 description: Creates a new pet in the store. Duplicates are allowed 60 operationId: addPet 61 produces: 62 - application/json 63 parameters: 64 - name: pet 65 in: body 66 description: Pet to add to the store 67 required: true 68 schema: 69 $ref: '#/definitions/newPet' 70 responses: 71 '200': 72 description: pet response 73 schema: 74 $ref: '#/definitions/pet' 75 default: 76 description: unexpected error 77 schema: 78 $ref: '#/definitions/errorModel' 79 /pets/{id}: 80 get: 81 description: Returns a user based on a single ID, if the user does not have access to the pet 82 operationId: findPetById 83 produces: 84 - application/json 85 - application/xml 86 - text/xml 87 - text/html 88 parameters: 89 - name: id 90 in: path 91 description: ID of pet to fetch 92 required: true 93 type: integer 94 format: int64 95 responses: 96 '200': 97 description: pet response 98 schema: 99 $ref: '#/definitions/pet' 100 default: 101 description: unexpected error 102 schema: 103 $ref: '#/definitions/errorModel' 104 delete: 105 description: deletes a single pet based on the ID supplied 106 operationId: deletePet 107 parameters: 108 - name: id 109 in: path 110 description: ID of pet to delete 111 required: true 112 type: integer 113 format: int64 114 responses: 115 '204': 116 description: pet deleted 117 default: 118 description: unexpected error 119 schema: 120 $ref: '#/definitions/errorModel' 121definitions: 122 pet: 123 required: 124 - id 125 - name 126 properties: 127 id: 128 type: integer 129 format: int64 130 name: 131 type: string 132 tag: 133 type: string 134 newPet: 135 required: 136 - name 137 properties: 138 id: 139 type: integer 140 format: int64 141 name: 142 type: string 143 tag: 144 type: string 145 errorModel: 146 required: 147 - code 148 - message 149 properties: 150 code: 151 type: integer 152 format: int32 153 message: 154 type: string 155 156