github.com/kaisawind/go-swagger@v0.19.0/examples/todo-list/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.swagger.examples.todo-list.v1+json"
    23    ],
    24    "produces": [
    25      "application/io.swagger.examples.todo-list.v1+json"
    26    ],
    27    "schemes": [
    28      "http",
    29      "https"
    30    ],
    31    "swagger": "2.0",
    32    "info": {
    33      "title": "Simple To Do List API",
    34      "version": "0.1.0"
    35    },
    36    "paths": {
    37      "/": {
    38        "get": {
    39          "tags": [
    40            "todos"
    41          ],
    42          "operationId": "find",
    43          "parameters": [
    44            {
    45              "type": "integer",
    46              "format": "int32",
    47              "name": "limit",
    48              "in": "formData",
    49              "required": true,
    50              "allowEmptyValue": true
    51            },
    52            {
    53              "type": "integer",
    54              "format": "int32",
    55              "name": "X-Rate-Limit",
    56              "in": "header",
    57              "required": true
    58            },
    59            {
    60              "type": "array",
    61              "items": {
    62                "type": "integer",
    63                "format": "int32"
    64              },
    65              "collectionFormat": "multi",
    66              "name": "tags",
    67              "in": "formData",
    68              "required": true,
    69              "allowEmptyValue": true
    70            }
    71          ],
    72          "responses": {
    73            "200": {
    74              "description": "OK",
    75              "schema": {
    76                "type": "array",
    77                "items": {
    78                  "$ref": "#/definitions/item"
    79                }
    80              }
    81            },
    82            "default": {
    83              "description": "error",
    84              "schema": {
    85                "$ref": "#/definitions/error"
    86              }
    87            }
    88          }
    89        },
    90        "post": {
    91          "tags": [
    92            "todos"
    93          ],
    94          "operationId": "addOne",
    95          "parameters": [
    96            {
    97              "name": "body",
    98              "in": "body",
    99              "schema": {
   100                "$ref": "#/definitions/item"
   101              }
   102            }
   103          ],
   104          "responses": {
   105            "201": {
   106              "description": "Created",
   107              "schema": {
   108                "$ref": "#/definitions/item"
   109              }
   110            },
   111            "default": {
   112              "description": "error",
   113              "schema": {
   114                "$ref": "#/definitions/error"
   115              }
   116            }
   117          }
   118        }
   119      },
   120      "/{id}": {
   121        "put": {
   122          "tags": [
   123            "todos"
   124          ],
   125          "operationId": "updateOne",
   126          "parameters": [
   127            {
   128              "name": "body",
   129              "in": "body",
   130              "schema": {
   131                "$ref": "#/definitions/item"
   132              }
   133            }
   134          ],
   135          "responses": {
   136            "200": {
   137              "description": "OK",
   138              "schema": {
   139                "$ref": "#/definitions/item"
   140              }
   141            },
   142            "default": {
   143              "description": "error",
   144              "schema": {
   145                "$ref": "#/definitions/error"
   146              }
   147            }
   148          }
   149        },
   150        "delete": {
   151          "tags": [
   152            "todos"
   153          ],
   154          "operationId": "destroyOne",
   155          "responses": {
   156            "204": {
   157              "description": "Deleted"
   158            },
   159            "default": {
   160              "description": "error",
   161              "schema": {
   162                "$ref": "#/definitions/error"
   163              }
   164            }
   165          }
   166        },
   167        "parameters": [
   168          {
   169            "type": "string",
   170            "name": "id",
   171            "in": "path",
   172            "required": true
   173          }
   174        ]
   175      }
   176    },
   177    "definitions": {
   178      "error": {
   179        "type": "object",
   180        "required": [
   181          "message"
   182        ],
   183        "properties": {
   184          "code": {
   185            "type": "integer",
   186            "format": "int64"
   187          },
   188          "message": {
   189            "type": "string"
   190          }
   191        }
   192      },
   193      "item": {
   194        "type": "object",
   195        "required": [
   196          "description"
   197        ],
   198        "properties": {
   199          "completed": {
   200            "type": "boolean"
   201          },
   202          "description": {
   203            "type": "string",
   204            "minLength": 1
   205          },
   206          "id": {
   207            "type": "integer",
   208            "format": "int64",
   209            "readOnly": true
   210          }
   211        }
   212      }
   213    },
   214    "securityDefinitions": {
   215      "key": {
   216        "type": "apiKey",
   217        "name": "x-todolist-token",
   218        "in": "header"
   219      }
   220    },
   221    "security": [
   222      {
   223        "key": null
   224      }
   225    ],
   226    "x-schemes": [
   227      "unix"
   228    ]
   229  }`))
   230  	FlatSwaggerJSON = json.RawMessage([]byte(`{
   231    "consumes": [
   232      "application/io.swagger.examples.todo-list.v1+json"
   233    ],
   234    "produces": [
   235      "application/io.swagger.examples.todo-list.v1+json"
   236    ],
   237    "schemes": [
   238      "http",
   239      "https"
   240    ],
   241    "swagger": "2.0",
   242    "info": {
   243      "title": "Simple To Do List API",
   244      "version": "0.1.0"
   245    },
   246    "paths": {
   247      "/": {
   248        "get": {
   249          "tags": [
   250            "todos"
   251          ],
   252          "operationId": "find",
   253          "parameters": [
   254            {
   255              "type": "integer",
   256              "format": "int32",
   257              "name": "limit",
   258              "in": "formData",
   259              "required": true,
   260              "allowEmptyValue": true
   261            },
   262            {
   263              "type": "integer",
   264              "format": "int32",
   265              "name": "X-Rate-Limit",
   266              "in": "header",
   267              "required": true
   268            },
   269            {
   270              "type": "array",
   271              "items": {
   272                "type": "integer",
   273                "format": "int32"
   274              },
   275              "collectionFormat": "multi",
   276              "name": "tags",
   277              "in": "formData",
   278              "required": true,
   279              "allowEmptyValue": true
   280            }
   281          ],
   282          "responses": {
   283            "200": {
   284              "description": "OK",
   285              "schema": {
   286                "type": "array",
   287                "items": {
   288                  "$ref": "#/definitions/item"
   289                }
   290              }
   291            },
   292            "default": {
   293              "description": "error",
   294              "schema": {
   295                "$ref": "#/definitions/error"
   296              }
   297            }
   298          }
   299        },
   300        "post": {
   301          "tags": [
   302            "todos"
   303          ],
   304          "operationId": "addOne",
   305          "parameters": [
   306            {
   307              "name": "body",
   308              "in": "body",
   309              "schema": {
   310                "$ref": "#/definitions/item"
   311              }
   312            }
   313          ],
   314          "responses": {
   315            "201": {
   316              "description": "Created",
   317              "schema": {
   318                "$ref": "#/definitions/item"
   319              }
   320            },
   321            "default": {
   322              "description": "error",
   323              "schema": {
   324                "$ref": "#/definitions/error"
   325              }
   326            }
   327          }
   328        }
   329      },
   330      "/{id}": {
   331        "put": {
   332          "tags": [
   333            "todos"
   334          ],
   335          "operationId": "updateOne",
   336          "parameters": [
   337            {
   338              "name": "body",
   339              "in": "body",
   340              "schema": {
   341                "$ref": "#/definitions/item"
   342              }
   343            }
   344          ],
   345          "responses": {
   346            "200": {
   347              "description": "OK",
   348              "schema": {
   349                "$ref": "#/definitions/item"
   350              }
   351            },
   352            "default": {
   353              "description": "error",
   354              "schema": {
   355                "$ref": "#/definitions/error"
   356              }
   357            }
   358          }
   359        },
   360        "delete": {
   361          "tags": [
   362            "todos"
   363          ],
   364          "operationId": "destroyOne",
   365          "responses": {
   366            "204": {
   367              "description": "Deleted"
   368            },
   369            "default": {
   370              "description": "error",
   371              "schema": {
   372                "$ref": "#/definitions/error"
   373              }
   374            }
   375          }
   376        },
   377        "parameters": [
   378          {
   379            "type": "string",
   380            "name": "id",
   381            "in": "path",
   382            "required": true
   383          }
   384        ]
   385      }
   386    },
   387    "definitions": {
   388      "error": {
   389        "type": "object",
   390        "required": [
   391          "message"
   392        ],
   393        "properties": {
   394          "code": {
   395            "type": "integer",
   396            "format": "int64"
   397          },
   398          "message": {
   399            "type": "string"
   400          }
   401        }
   402      },
   403      "item": {
   404        "type": "object",
   405        "required": [
   406          "description"
   407        ],
   408        "properties": {
   409          "completed": {
   410            "type": "boolean"
   411          },
   412          "description": {
   413            "type": "string",
   414            "minLength": 1
   415          },
   416          "id": {
   417            "type": "integer",
   418            "format": "int64",
   419            "readOnly": true
   420          }
   421        }
   422      }
   423    },
   424    "securityDefinitions": {
   425      "key": {
   426        "type": "apiKey",
   427        "name": "x-todolist-token",
   428        "in": "header"
   429      }
   430    },
   431    "security": [
   432      {
   433        "key": []
   434      }
   435    ],
   436    "x-schemes": [
   437      "unix"
   438    ]
   439  }`))
   440  }