github.com/kaisawind/go-swagger@v0.19.0/fixtures/codegen/swagger-codegen-tests.json (about)

     1  {
     2    "swagger": "2.0",
     3    "info": {
     4      "description": "This is a sample server Petstore server.  You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger.  For this sample, you can use the api key \"special-key\" to test the authorization filters",
     5      "version": "1.0.0",
     6      "title": "Swagger Petstore",
     7      "termsOfService": "http://helloreverb.com/terms/",
     8      "contact": {
     9        "email": "apiteam@wordnik.com"
    10      },
    11      "license": {
    12        "name": "Apache 2.0",
    13        "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    14      }
    15    },
    16    "host": "petstore.swagger.io",
    17    "basePath": "/v2",
    18    "schemes": [
    19      "http"
    20    ],
    21    "paths": {
    22      "/pet": {
    23        "post": {
    24          "tags": [
    25            "pet"
    26          ],
    27          "summary": "Add a new pet to the store",
    28          "description": "",
    29          "operationId": "addPet",
    30          "consumes": [
    31            "application/json",
    32            "application/xml"
    33          ],
    34          "produces": [
    35            "application/json",
    36            "application/xml"
    37          ],
    38          "parameters": [{
    39            "in": "body",
    40            "name": "body",
    41            "description": "Pet object that needs to be added to the store",
    42            "required": false,
    43            "schema": {
    44              "$ref": "#/definitions/Pet"
    45            }
    46          }],
    47          "responses": {
    48            "405": {
    49              "description": "Invalid input"
    50            }
    51          },
    52          "security": [{
    53            "petstore_auth": [
    54              "write:pets",
    55              "read:pets"
    56            ]
    57          }]
    58        },
    59        "put": {
    60          "tags": [
    61            "pet"
    62          ],
    63          "summary": "Update an existing pet",
    64          "description": "",
    65          "operationId": "updatePet",
    66          "consumes": [
    67            "application/json",
    68            "application/xml"
    69          ],
    70          "produces": [
    71            "application/json",
    72            "application/xml"
    73          ],
    74          "parameters": [{
    75            "in": "body",
    76            "name": "body",
    77            "description": "Pet object that needs to be added to the store",
    78            "required": false,
    79            "schema": {
    80              "$ref": "#/definitions/Pet"
    81            }
    82          }],
    83          "responses": {
    84            "405": {
    85              "description": "Validation exception"
    86            },
    87            "404": {
    88              "description": "Pet not found"
    89            },
    90            "400": {
    91              "description": "Invalid ID supplied"
    92            }
    93          },
    94          "security": [{
    95            "petstore_auth": [
    96              "write:pets",
    97              "read:pets"
    98            ]
    99          }]
   100        }
   101      },
   102      "/pet/findByStatus": {
   103        "get": {
   104          "tags": [
   105            "pet"
   106          ],
   107          "summary": "Finds Pets by status",
   108          "description": "Multiple status values can be provided with comma seperated strings",
   109          "operationId": "findPetsByStatus",
   110          "produces": [
   111            "application/json",
   112            "application/xml"
   113          ],
   114          "parameters": [{
   115            "name": "status",
   116            "in": "query",
   117            "description": "Status values that need to be considered for filter",
   118            "required": false,
   119            "type": "array",
   120            "items": {
   121              "type": "string"
   122            },
   123            "collectionFormat": "multi",
   124            "default": ["available"]
   125          }],
   126          "responses": {
   127            "200": {
   128              "description": "successful operation",
   129              "schema": {
   130                "type": "array",
   131                "items": {
   132                  "$ref": "#/definitions/Pet"
   133                }
   134              }
   135            },
   136            "400": {
   137              "description": "Invalid status value"
   138            }
   139          },
   140          "security": [{
   141            "petstore_auth": [
   142              "write:pets",
   143              "read:pets"
   144            ]
   145          }]
   146        }
   147      },
   148      "/pet/findByTags": {
   149        "get": {
   150          "tags": [
   151            "pet"
   152          ],
   153          "summary": "Finds Pets by tags",
   154          "description": "Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.",
   155          "operationId": "findPetsByTags",
   156          "produces": [
   157            "application/json",
   158            "application/xml"
   159          ],
   160          "parameters": [{
   161            "name": "tags",
   162            "in": "query",
   163            "description": "Tags to filter by",
   164            "required": false,
   165            "type": "array",
   166            "items": {
   167              "type": "string"
   168            },
   169            "collectionFormat": "multi"
   170          }],
   171          "responses": {
   172            "200": {
   173              "description": "successful operation",
   174              "schema": {
   175                "type": "array",
   176                "items": {
   177                  "$ref": "#/definitions/Pet"
   178                }
   179              }
   180            },
   181            "400": {
   182              "description": "Invalid tag value"
   183            }
   184          },
   185          "security": [{
   186            "petstore_auth": [
   187              "write:pets",
   188              "read:pets"
   189            ]
   190          }]
   191        }
   192      },
   193      "/pet/{petId}": {
   194        "get": {
   195          "tags": [
   196            "pet"
   197          ],
   198          "summary": "Find pet by ID",
   199          "description": "Returns a pet when ID < 10.  ID > 10 or nonintegers will simulate API error conditions",
   200          "operationId": "getPetById",
   201          "produces": [
   202            "application/json",
   203            "application/xml"
   204          ],
   205          "parameters": [{
   206            "name": "petId",
   207            "in": "path",
   208            "description": "ID of pet that needs to be fetched",
   209            "required": true,
   210            "type": "integer",
   211            "format": "int64"
   212          }],
   213          "responses": {
   214            "404": {
   215              "description": "Pet not found"
   216            },
   217            "200": {
   218              "description": "successful operation",
   219              "schema": {
   220                "$ref": "#/definitions/Pet"
   221              }
   222            },
   223            "400": {
   224              "description": "Invalid ID supplied"
   225            }
   226          },
   227          "security": [{
   228            "api_key": []
   229          }, {
   230            "petstore_auth": [
   231              "write:pets",
   232              "read:pets"
   233            ]
   234          }]
   235        },
   236        "post": {
   237          "tags": [
   238            "pet"
   239          ],
   240          "summary": "Updates a pet in the store with form data",
   241          "description": "",
   242          "operationId": "updatePetWithForm",
   243          "consumes": [
   244            "application/x-www-form-urlencoded"
   245          ],
   246          "produces": [
   247            "application/json",
   248            "application/xml"
   249          ],
   250          "parameters": [{
   251            "name": "petId",
   252            "in": "path",
   253            "description": "ID of pet that needs to be updated",
   254            "required": true,
   255            "type": "string"
   256          }, {
   257            "name": "name",
   258            "in": "formData",
   259            "description": "Updated name of the pet",
   260            "required": false,
   261            "type": "string"
   262          }, {
   263            "name": "status",
   264            "in": "formData",
   265            "description": "Updated status of the pet",
   266            "required": false,
   267            "type": "string"
   268          }],
   269          "responses": {
   270            "405": {
   271              "description": "Invalid input"
   272            }
   273          },
   274          "security": [{
   275            "petstore_auth": [
   276              "write:pets",
   277              "read:pets"
   278            ]
   279          }]
   280        },
   281        "delete": {
   282          "tags": [
   283            "pet"
   284          ],
   285          "summary": "Deletes a pet",
   286          "description": "",
   287          "operationId": "deletePet",
   288          "produces": [
   289            "application/json",
   290            "application/xml"
   291          ],
   292          "parameters": [{
   293            "name": "api_key",
   294            "in": "header",
   295            "description": "",
   296            "required": false,
   297            "type": "string"
   298          }, {
   299            "name": "petId",
   300            "in": "path",
   301            "description": "Pet id to delete",
   302            "required": true,
   303            "type": "integer",
   304            "format": "int64"
   305          }],
   306          "responses": {
   307            "400": {
   308              "description": "Invalid pet value"
   309            }
   310          },
   311          "security": [{
   312            "petstore_auth": [
   313              "write:pets",
   314              "read:pets"
   315            ]
   316          }]
   317        }
   318      },
   319      "/pet/{petId}/uploadImage": {
   320        "post": {
   321          "tags": [
   322            "pet"
   323          ],
   324          "summary": "uploads an image",
   325          "description": "",
   326          "operationId": "uploadFile",
   327          "consumes": [
   328            "multipart/form-data"
   329          ],
   330          "produces": [
   331            "application/json",
   332            "application/xml"
   333          ],
   334          "parameters": [{
   335            "name": "petId",
   336            "in": "path",
   337            "description": "ID of pet to update",
   338            "required": true,
   339            "type": "integer",
   340            "format": "int64"
   341          }, {
   342            "name": "additionalMetadata",
   343            "in": "formData",
   344            "description": "Additional data to pass to server",
   345            "required": false,
   346            "type": "string"
   347          }, {
   348            "name": "file",
   349            "in": "formData",
   350            "description": "file to upload",
   351            "required": false,
   352            "type": "file"
   353          }],
   354          "responses": {
   355            "default": {
   356              "description": "successful operation"
   357            }
   358          },
   359          "security": [{
   360            "petstore_auth": [
   361              "write:pets",
   362              "read:pets"
   363            ]
   364          }]
   365        }
   366      },
   367      "/store/inventory": {
   368        "get": {
   369          "tags": [
   370            "store"
   371          ],
   372          "summary": "Returns pet inventories by status",
   373          "description": "Returns a map of status codes to quantities",
   374          "operationId": "getInventory",
   375          "produces": [
   376            "application/json",
   377            "application/xml"
   378          ],
   379          "responses": {
   380            "200": {
   381              "description": "successful operation",
   382              "schema": {
   383                "type": "object",
   384                "additionalProperties": {
   385                  "type": "integer",
   386                  "format": "int32"
   387                }
   388              }
   389            }
   390          },
   391          "security": [{
   392            "api_key": []
   393          }]
   394        }
   395      },
   396      "/store/order": {
   397        "post": {
   398          "tags": [
   399            "store"
   400          ],
   401          "summary": "Place an order for a pet",
   402          "description": "",
   403          "operationId": "placeOrder",
   404          "produces": [
   405            "application/json",
   406            "application/xml"
   407          ],
   408          "parameters": [{
   409            "in": "body",
   410            "name": "body",
   411            "description": "order placed for purchasing the pet",
   412            "required": false,
   413            "schema": {
   414              "$ref": "#/definitions/Order"
   415            }
   416          }],
   417          "responses": {
   418            "200": {
   419              "description": "successful operation",
   420              "schema": {
   421                "$ref": "#/definitions/Order"
   422              }
   423            },
   424            "400": {
   425              "description": "Invalid Order"
   426            }
   427          }
   428        }
   429      },
   430      "/store/order/{orderId}": {
   431        "get": {
   432          "tags": [
   433            "store"
   434          ],
   435          "summary": "Find purchase order by ID",
   436          "description": "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions",
   437          "operationId": "getOrderById",
   438          "produces": [
   439            "application/json",
   440            "application/xml"
   441          ],
   442          "parameters": [{
   443            "name": "orderId",
   444            "in": "path",
   445            "description": "ID of pet that needs to be fetched",
   446            "required": true,
   447            "type": "string"
   448          }],
   449          "responses": {
   450            "404": {
   451              "description": "Order not found"
   452            },
   453            "200": {
   454              "description": "successful operation",
   455              "schema": {
   456                "$ref": "#/definitions/Order"
   457              }
   458            },
   459            "400": {
   460              "description": "Invalid ID supplied"
   461            }
   462          }
   463        },
   464        "delete": {
   465          "tags": [
   466            "store"
   467          ],
   468          "summary": "Delete purchase order by ID",
   469          "description": "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors",
   470          "operationId": "deleteOrder",
   471          "produces": [
   472            "application/json",
   473            "application/xml"
   474          ],
   475          "parameters": [{
   476            "name": "orderId",
   477            "in": "path",
   478            "description": "ID of the order that needs to be deleted",
   479            "required": true,
   480            "type": "string"
   481          }],
   482          "responses": {
   483            "404": {
   484              "description": "Order not found"
   485            },
   486            "400": {
   487              "description": "Invalid ID supplied"
   488            }
   489          }
   490        }
   491      },
   492      "/user": {
   493        "post": {
   494          "tags": [
   495            "user"
   496          ],
   497          "summary": "Create user",
   498          "description": "This can only be done by the logged in user.",
   499          "operationId": "createUser",
   500          "produces": [
   501            "application/json",
   502            "application/xml"
   503          ],
   504          "parameters": [{
   505            "in": "body",
   506            "name": "body",
   507            "description": "Created user object",
   508            "required": false,
   509            "schema": {
   510              "$ref": "#/definitions/User"
   511            }
   512          }],
   513          "responses": {
   514            "default": {
   515              "description": "successful operation"
   516            }
   517          }
   518        }
   519      },
   520      "/user/createWithArray": {
   521        "post": {
   522          "tags": [
   523            "user"
   524          ],
   525          "summary": "Creates list of users with given input array",
   526          "description": "",
   527          "operationId": "createUsersWithArrayInput",
   528          "produces": [
   529            "application/json",
   530            "application/xml"
   531          ],
   532          "parameters": [{
   533            "in": "body",
   534            "name": "body",
   535            "description": "List of user object",
   536            "required": false,
   537            "schema": {
   538              "type": "array",
   539              "items": {
   540                "$ref": "#/definitions/User"
   541              }
   542            }
   543          }],
   544          "responses": {
   545            "default": {
   546              "description": "successful operation"
   547            }
   548          }
   549        }
   550      },
   551      "/user/createWithList": {
   552        "post": {
   553          "tags": [
   554            "user"
   555          ],
   556          "summary": "Creates list of users with given input array",
   557          "description": "",
   558          "operationId": "createUsersWithListInput",
   559          "produces": [
   560            "application/json",
   561            "application/xml"
   562          ],
   563          "parameters": [{
   564            "in": "body",
   565            "name": "body",
   566            "description": "List of user object",
   567            "required": false,
   568            "schema": {
   569              "type": "array",
   570              "items": {
   571                "$ref": "#/definitions/User"
   572              }
   573            }
   574          }],
   575          "responses": {
   576            "default": {
   577              "description": "successful operation"
   578            }
   579          }
   580        }
   581      },
   582      "/user/login": {
   583        "get": {
   584          "tags": [
   585            "user"
   586          ],
   587          "summary": "Logs user into the system",
   588          "description": "",
   589          "operationId": "loginUser",
   590          "produces": [
   591            "application/json",
   592            "application/xml"
   593          ],
   594          "parameters": [{
   595            "name": "username",
   596            "in": "query",
   597            "description": "The user name for login",
   598            "required": false,
   599            "type": "string"
   600          }, {
   601            "name": "password",
   602            "in": "query",
   603            "description": "The password for login in clear text",
   604            "required": false,
   605            "type": "string"
   606          }],
   607          "responses": {
   608            "200": {
   609              "description": "successful operation",
   610              "schema": {
   611                "type": "string"
   612              }
   613            },
   614            "400": {
   615              "description": "Invalid username/password supplied"
   616            }
   617          }
   618        }
   619      },
   620      "/user/logout": {
   621        "get": {
   622          "tags": [
   623            "user"
   624          ],
   625          "summary": "Logs out current logged in user session",
   626          "description": "",
   627          "operationId": "logoutUser",
   628          "produces": [
   629            "application/json",
   630            "application/xml"
   631          ],
   632          "responses": {
   633            "default": {
   634              "description": "successful operation"
   635            }
   636          }
   637        }
   638      },
   639      "/user/{username}": {
   640        "get": {
   641          "tags": [
   642            "user"
   643          ],
   644          "summary": "Get user by user name",
   645          "description": "",
   646          "operationId": "getUserByName",
   647          "produces": [
   648            "application/json",
   649            "application/xml"
   650          ],
   651          "parameters": [{
   652            "name": "username",
   653            "in": "path",
   654            "description": "The name that needs to be fetched. Use user1 for testing. ",
   655            "required": true,
   656            "type": "string"
   657          }],
   658          "responses": {
   659            "404": {
   660              "description": "User not found"
   661            },
   662            "200": {
   663              "description": "successful operation",
   664              "schema": {
   665                "$ref": "#/definitions/User"
   666              },
   667              "examples": {
   668                "application/json": {
   669                  "id": 1,
   670                  "username": "johnp",
   671                  "firstName": "John",
   672                  "lastName": "Public",
   673                  "email": "johnp@swagger.io",
   674                  "password": "-secret-",
   675                  "phone": "0123456789",
   676                  "userStatus": 0
   677                }
   678              }
   679            },
   680            "400": {
   681              "description": "Invalid username supplied"
   682            }
   683          }
   684        },
   685        "put": {
   686          "tags": [
   687            "user"
   688          ],
   689          "summary": "Updated user",
   690          "description": "This can only be done by the logged in user.",
   691          "operationId": "updateUser",
   692          "produces": [
   693            "application/json",
   694            "application/xml"
   695          ],
   696          "parameters": [{
   697            "name": "username",
   698            "in": "path",
   699            "description": "name that need to be deleted",
   700            "required": true,
   701            "type": "string"
   702          }, {
   703            "in": "body",
   704            "name": "body",
   705            "description": "Updated user object",
   706            "required": false,
   707            "schema": {
   708              "$ref": "#/definitions/User"
   709            }
   710          }],
   711          "responses": {
   712            "404": {
   713              "description": "User not found"
   714            },
   715            "400": {
   716              "description": "Invalid user supplied"
   717            }
   718          }
   719        },
   720        "delete": {
   721          "tags": [
   722            "user"
   723          ],
   724          "summary": "Delete user",
   725          "description": "This can only be done by the logged in user.",
   726          "operationId": "deleteUser",
   727          "produces": [
   728            "application/json",
   729            "application/xml"
   730          ],
   731          "parameters": [{
   732            "name": "username",
   733            "in": "path",
   734            "description": "The name that needs to be deleted",
   735            "required": true,
   736            "type": "string"
   737          }],
   738          "responses": {
   739            "404": {
   740              "description": "User not found"
   741            },
   742            "400": {
   743              "description": "Invalid username supplied"
   744            }
   745          }
   746        }
   747      }
   748    },
   749    "securityDefinitions": {
   750      "api_key": {
   751        "type": "apiKey",
   752        "name": "api_key",
   753        "in": "header"
   754      },
   755      "petstore_auth": {
   756        "type": "oauth2",
   757        "authorizationUrl": "http://petstore.swagger.io/api/oauth/dialog",
   758        "flow": "implicit",
   759        "scopes": {
   760          "write:pets": "modify pets in your account",
   761          "read:pets": "read your pets"
   762        }
   763      }
   764    },
   765    "definitions": {
   766      "User": {
   767        "properties": {
   768          "id": {
   769            "type": "integer",
   770            "format": "int64"
   771          },
   772          "username": {
   773            "type": "string"
   774          },
   775          "firstName": {
   776            "type": "string"
   777          },
   778          "lastName": {
   779            "type": "string"
   780          },
   781          "email": {
   782            "type": "string"
   783          },
   784          "password": {
   785            "type": "string"
   786          },
   787          "phone": {
   788            "type": "string"
   789          },
   790          "userStatus": {
   791            "type": "integer",
   792            "format": "int32",
   793            "description": "User Status"
   794          }
   795        },
   796        "xml": {
   797          "name": "User"
   798        }
   799      },
   800      "Category": {
   801        "properties": {
   802          "id": {
   803            "type": "integer",
   804            "format": "int64"
   805          },
   806          "name": {
   807            "type": "string"
   808          }
   809        },
   810        "xml": {
   811          "name": "Category"
   812        }
   813      },
   814      "Pet": {
   815        "required": [
   816          "name",
   817          "photoUrls"
   818        ],
   819        "properties": {
   820          "id": {
   821            "type": "integer",
   822            "format": "int64"
   823          },
   824          "category": {
   825            "$ref": "#/definitions/Category"
   826          },
   827          "name": {
   828            "type": "string",
   829            "example": "doggie"
   830          },
   831          "photoUrls": {
   832            "type": "array",
   833            "xml": {
   834              "name": "photoUrl",
   835              "wrapped": true
   836            },
   837            "items": {
   838              "type": "string"
   839            }
   840          },
   841          "tags": {
   842            "type": "array",
   843            "xml": {
   844              "name": "tag",
   845              "wrapped": true
   846            },
   847            "items": {
   848              "$ref": "#/definitions/Tag"
   849            }
   850          },
   851          "status": {
   852            "type": "string",
   853            "description": "pet status in the store",
   854            "enum": [
   855              "available",
   856              "pending",
   857              "sold"
   858            ]
   859          }
   860        },
   861        "xml": {
   862          "name": "Pet"
   863        }
   864      },
   865      "Tag": {
   866        "properties": {
   867          "id": {
   868            "type": "integer",
   869            "format": "int64"
   870          },
   871          "name": {
   872            "type": "string"
   873          }
   874        },
   875        "xml": {
   876          "name": "Tag"
   877        }
   878      },
   879      "Order": {
   880        "properties": {
   881          "id": {
   882            "type": "integer",
   883            "format": "int64"
   884          },
   885          "petId": {
   886            "type": "integer",
   887            "format": "int64"
   888          },
   889          "quantity": {
   890            "type": "integer",
   891            "format": "int32"
   892          },
   893          "shipDate": {
   894            "type": "string",
   895            "format": "date-time"
   896          },
   897          "status": {
   898            "type": "string",
   899            "description": "Order Status",
   900            "enum": [
   901              "placed",
   902              "approved",
   903              "delivered"
   904            ]
   905          },
   906          "complete": {
   907            "type": "boolean"
   908          }
   909        },
   910        "xml": {
   911          "name": "Order"
   912        }
   913      }
   914    }
   915  }