github.com/circl-dev/go-swagger@v0.31.0/examples/tutorials/todo-list/server-complete/restapi/embedded_spec.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package restapi 4 5 // This file was generated by the swagger tool. 6 // Editing this file might prove futile when you re-run the swagger generate command 7 8 import ( 9 "encoding/json" 10 ) 11 12 var ( 13 // SwaggerJSON embedded version of the swagger document used at generation time 14 SwaggerJSON json.RawMessage 15 // FlatSwaggerJSON embedded flattened version of the swagger document used at generation time 16 FlatSwaggerJSON json.RawMessage 17 ) 18 19 func init() { 20 SwaggerJSON = json.RawMessage([]byte(`{ 21 "consumes": [ 22 "application/io.goswagger.examples.todo-list.v1+json" 23 ], 24 "produces": [ 25 "application/io.goswagger.examples.todo-list.v1+json" 26 ], 27 "schemes": [ 28 "http" 29 ], 30 "swagger": "2.0", 31 "info": { 32 "description": "The product of a tutorial on goswagger.io", 33 "title": "A To Do list application", 34 "version": "1.0.0" 35 }, 36 "paths": { 37 "/": { 38 "get": { 39 "tags": [ 40 "todos" 41 ], 42 "operationId": "findTodos", 43 "parameters": [ 44 { 45 "type": "integer", 46 "format": "int64", 47 "name": "since", 48 "in": "query" 49 }, 50 { 51 "type": "integer", 52 "format": "int32", 53 "default": 20, 54 "name": "limit", 55 "in": "query" 56 } 57 ], 58 "responses": { 59 "200": { 60 "description": "list the todo operations", 61 "schema": { 62 "type": "array", 63 "items": { 64 "$ref": "#/definitions/item" 65 } 66 } 67 }, 68 "default": { 69 "description": "generic error response", 70 "schema": { 71 "$ref": "#/definitions/error" 72 } 73 } 74 } 75 }, 76 "post": { 77 "tags": [ 78 "todos" 79 ], 80 "operationId": "addOne", 81 "parameters": [ 82 { 83 "name": "body", 84 "in": "body", 85 "schema": { 86 "$ref": "#/definitions/item" 87 } 88 } 89 ], 90 "responses": { 91 "201": { 92 "description": "Created", 93 "schema": { 94 "$ref": "#/definitions/item" 95 } 96 }, 97 "default": { 98 "description": "error", 99 "schema": { 100 "$ref": "#/definitions/error" 101 } 102 } 103 } 104 } 105 }, 106 "/{id}": { 107 "put": { 108 "tags": [ 109 "todos" 110 ], 111 "operationId": "updateOne", 112 "parameters": [ 113 { 114 "name": "body", 115 "in": "body", 116 "schema": { 117 "$ref": "#/definitions/item" 118 } 119 } 120 ], 121 "responses": { 122 "200": { 123 "description": "OK", 124 "schema": { 125 "$ref": "#/definitions/item" 126 } 127 }, 128 "default": { 129 "description": "error", 130 "schema": { 131 "$ref": "#/definitions/error" 132 } 133 } 134 } 135 }, 136 "delete": { 137 "tags": [ 138 "todos" 139 ], 140 "operationId": "destroyOne", 141 "responses": { 142 "204": { 143 "description": "Deleted" 144 }, 145 "default": { 146 "description": "error", 147 "schema": { 148 "$ref": "#/definitions/error" 149 } 150 } 151 } 152 }, 153 "parameters": [ 154 { 155 "type": "integer", 156 "format": "int64", 157 "name": "id", 158 "in": "path", 159 "required": true 160 } 161 ] 162 } 163 }, 164 "definitions": { 165 "error": { 166 "type": "object", 167 "required": [ 168 "message" 169 ], 170 "properties": { 171 "code": { 172 "type": "integer", 173 "format": "int64" 174 }, 175 "message": { 176 "type": "string" 177 } 178 } 179 }, 180 "item": { 181 "type": "object", 182 "required": [ 183 "description" 184 ], 185 "properties": { 186 "completed": { 187 "type": "boolean" 188 }, 189 "description": { 190 "type": "string", 191 "minLength": 1 192 }, 193 "id": { 194 "type": "integer", 195 "format": "int64", 196 "readOnly": true 197 } 198 } 199 } 200 } 201 }`)) 202 FlatSwaggerJSON = json.RawMessage([]byte(`{ 203 "consumes": [ 204 "application/io.goswagger.examples.todo-list.v1+json" 205 ], 206 "produces": [ 207 "application/io.goswagger.examples.todo-list.v1+json" 208 ], 209 "schemes": [ 210 "http" 211 ], 212 "swagger": "2.0", 213 "info": { 214 "description": "The product of a tutorial on goswagger.io", 215 "title": "A To Do list application", 216 "version": "1.0.0" 217 }, 218 "paths": { 219 "/": { 220 "get": { 221 "tags": [ 222 "todos" 223 ], 224 "operationId": "findTodos", 225 "parameters": [ 226 { 227 "type": "integer", 228 "format": "int64", 229 "name": "since", 230 "in": "query" 231 }, 232 { 233 "type": "integer", 234 "format": "int32", 235 "default": 20, 236 "name": "limit", 237 "in": "query" 238 } 239 ], 240 "responses": { 241 "200": { 242 "description": "list the todo operations", 243 "schema": { 244 "type": "array", 245 "items": { 246 "$ref": "#/definitions/item" 247 } 248 } 249 }, 250 "default": { 251 "description": "generic error response", 252 "schema": { 253 "$ref": "#/definitions/error" 254 } 255 } 256 } 257 }, 258 "post": { 259 "tags": [ 260 "todos" 261 ], 262 "operationId": "addOne", 263 "parameters": [ 264 { 265 "name": "body", 266 "in": "body", 267 "schema": { 268 "$ref": "#/definitions/item" 269 } 270 } 271 ], 272 "responses": { 273 "201": { 274 "description": "Created", 275 "schema": { 276 "$ref": "#/definitions/item" 277 } 278 }, 279 "default": { 280 "description": "error", 281 "schema": { 282 "$ref": "#/definitions/error" 283 } 284 } 285 } 286 } 287 }, 288 "/{id}": { 289 "put": { 290 "tags": [ 291 "todos" 292 ], 293 "operationId": "updateOne", 294 "parameters": [ 295 { 296 "name": "body", 297 "in": "body", 298 "schema": { 299 "$ref": "#/definitions/item" 300 } 301 } 302 ], 303 "responses": { 304 "200": { 305 "description": "OK", 306 "schema": { 307 "$ref": "#/definitions/item" 308 } 309 }, 310 "default": { 311 "description": "error", 312 "schema": { 313 "$ref": "#/definitions/error" 314 } 315 } 316 } 317 }, 318 "delete": { 319 "tags": [ 320 "todos" 321 ], 322 "operationId": "destroyOne", 323 "responses": { 324 "204": { 325 "description": "Deleted" 326 }, 327 "default": { 328 "description": "error", 329 "schema": { 330 "$ref": "#/definitions/error" 331 } 332 } 333 } 334 }, 335 "parameters": [ 336 { 337 "type": "integer", 338 "format": "int64", 339 "name": "id", 340 "in": "path", 341 "required": true 342 } 343 ] 344 } 345 }, 346 "definitions": { 347 "error": { 348 "type": "object", 349 "required": [ 350 "message" 351 ], 352 "properties": { 353 "code": { 354 "type": "integer", 355 "format": "int64" 356 }, 357 "message": { 358 "type": "string" 359 } 360 } 361 }, 362 "item": { 363 "type": "object", 364 "required": [ 365 "description" 366 ], 367 "properties": { 368 "completed": { 369 "type": "boolean" 370 }, 371 "description": { 372 "type": "string", 373 "minLength": 1 374 }, 375 "id": { 376 "type": "integer", 377 "format": "int64", 378 "readOnly": true 379 } 380 } 381 } 382 } 383 }`)) 384 }