github.com/rzurga/go-swagger@v0.28.1-0.20211109195225-5d1f453ffa3a/fixtures/specs/refed.json (about) 1 { 2 "swagger": "2.0", 3 "info": { 4 "version": "1.0.0", 5 "title": "Swagger Petstore", 6 "description": "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification", 7 "termsOfService": "http://helloreverb.com/terms/", 8 "contact": { 9 "name": "Wordnik API Team" 10 }, 11 "license": { 12 "name": "MIT" 13 } 14 }, 15 "host": "petstore.swagger.wordnik.com", 16 "basePath": "/api", 17 "schemes": [ 18 "http" 19 ], 20 "consumes": [ 21 "application/json" 22 ], 23 "produces": [ 24 "application/json" 25 ], 26 "parameters": { 27 "idParam": { 28 "name": "id", 29 "in": "path", 30 "description": "ID of pet to fetch", 31 "required": true, 32 "type": "integer", 33 "format": "int64" 34 } 35 }, 36 "responses": { 37 "petResponse": { 38 "description": "pet response", 39 "schema": { 40 "$ref": "#/definitions/pet" 41 } 42 } 43 }, 44 "paths": { 45 "/pets": { 46 "get": { 47 "description": "Returns all pets from the system that the user has access to", 48 "operationId": "findPets", 49 "produces": [ 50 "application/json", 51 "application/xml", 52 "text/xml", 53 "text/html" 54 ], 55 "parameters": [ 56 { 57 "name": "tags", 58 "in": "query", 59 "description": "tags to filter by", 60 "required": false, 61 "type": "array", 62 "items": { 63 "type": "string" 64 }, 65 "collectionFormat": "csv" 66 }, 67 { 68 "name": "limit", 69 "in": "query", 70 "description": "maximum number of results to return", 71 "required": false, 72 "type": "integer", 73 "format": "int32" 74 } 75 ], 76 "responses": { 77 "200": { 78 "description": "pet response", 79 "schema": { 80 "type": "array", 81 "items": { 82 "$ref": "#/definitions/pet" 83 } 84 } 85 }, 86 "default": { 87 "description": "unexpected error", 88 "schema": { 89 "$ref": "#/definitions/errorModel" 90 } 91 } 92 } 93 }, 94 "post": { 95 "description": "Creates a new pet in the store. Duplicates are allowed", 96 "operationId": "addPet", 97 "produces": [ 98 "application/json" 99 ], 100 "parameters": [ 101 { 102 "name": "pet", 103 "in": "body", 104 "description": "Pet to add to the store", 105 "required": true, 106 "schema": { 107 "$ref": "#/definitions/petInput" 108 } 109 } 110 ], 111 "responses": { 112 "200": { "$ref": "#/responses/petResponse" }, 113 "default": { 114 "description": "unexpected error", 115 "schema": { 116 "$ref": "#/definitions/errorModel" 117 } 118 } 119 } 120 } 121 }, 122 "/pets/{id}": { 123 "get": { 124 "description": "Returns a user based on a single ID, if the user does not have access to the pet", 125 "operationId": "findPetById", 126 "produces": [ 127 "application/json", 128 "application/xml", 129 "text/xml", 130 "text/html" 131 ], 132 "parameters": [ 133 { 134 "$ref": "#/parameters/idParam" 135 } 136 ], 137 "responses": { 138 "200": { 139 "$ref": "#/responses/petResponse" 140 }, 141 "default": { 142 "description": "unexpected error", 143 "schema": { 144 "$ref": "#/definitions/errorModel" 145 } 146 } 147 } 148 }, 149 "delete": { 150 "description": "deletes a single pet based on the ID supplied", 151 "operationId": "deletePet", 152 "parameters": [ 153 { 154 "$ref": "#/parameters/idParam" 155 } 156 ], 157 "responses": { 158 "204": { 159 "description": "pet deleted" 160 }, 161 "default": { 162 "description": "unexpected error", 163 "schema": { 164 "$ref": "#/definitions/errorModel" 165 } 166 } 167 } 168 } 169 } 170 }, 171 "definitions": { 172 "pet": { 173 "required": [ 174 "id", 175 "name" 176 ], 177 "properties": { 178 "id": { 179 "type": "integer", 180 "format": "int64" 181 }, 182 "name": { 183 "type": "string" 184 }, 185 "tag": { 186 "type": "string" 187 } 188 } 189 }, 190 "petInput": { 191 "allOf": [ 192 { 193 "$ref": "pet" 194 }, 195 { 196 "required": [ 197 "name" 198 ], 199 "properties": { 200 "id": { 201 "type": "integer", 202 "format": "int64" 203 } 204 } 205 } 206 ] 207 }, 208 "errorModel": { 209 "required": [ 210 "code", 211 "message" 212 ], 213 "properties": { 214 "code": { 215 "type": "integer", 216 "format": "int32" 217 }, 218 "message": { 219 "type": "string" 220 } 221 } 222 } 223 } 224 }