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