...

Text file src/github.com/go-openapi/validate/fixtures/petstore/swagger.json

Documentation: github.com/go-openapi/validate/fixtures/petstore

     1{
     2  "swagger": "2.0",
     3  "info": {
     4    "version": "1.0.0",
     5    "title": "Swagger Petstore",
     6    "contact": {
     7      "name": "Wordnik API Team",
     8      "url": "http://developer.wordnik.com"
     9    },
    10    "license": {
    11      "name": "Creative Commons 4.0 International",
    12      "url": "http://creativecommons.org/licenses/by/4.0/"
    13    }
    14  },
    15  "host": "petstore.swagger.wordnik.com",
    16  "basePath": "/api",
    17  "schemes": [
    18    "http"
    19  ],
    20  "paths": {
    21    "/pets": {
    22      "get": {
    23        "security": [
    24          {
    25            "basic": []
    26          }
    27        ],
    28        "tags": [ "Pet Operations" ],
    29        "operationId": "getAllPets",
    30        "parameters": [
    31          {
    32            "name": "status",
    33            "in": "query",
    34            "description": "The status to filter by",
    35            "type": "string"
    36          },
    37          {
    38            "name": "limit",
    39            "in": "query",
    40            "description": "The maximum number of results to return",
    41            "type": "integer",
    42						"format": "int64"
    43          }
    44        ],
    45        "summary": "Finds all pets in the system",
    46        "responses": {
    47          "200": {
    48            "description": "Pet response",
    49            "schema": {
    50              "type": "array",
    51              "items": {
    52                "$ref": "#/definitions/Pet"
    53              }
    54            }
    55          },
    56          "default": {
    57            "description": "Unexpected error",
    58            "schema": {
    59              "$ref": "#/definitions/Error"
    60            }
    61          }
    62        }
    63      },
    64      "post": {
    65        "security": [
    66          {
    67            "basic": []
    68          }
    69        ],
    70        "tags": [ "Pet Operations" ],
    71        "operationId": "createPet",
    72        "summary": "Creates a new pet",
    73        "consumes": ["application/x-yaml"],
    74        "produces": ["application/x-yaml"],
    75        "parameters": [
    76          {
    77            "name": "pet",
    78            "in": "body",
    79            "description": "The Pet to create",
    80            "required": true,
    81            "schema": {
    82              "$ref": "#/definitions/newPet"
    83            }
    84          }
    85        ],
    86        "responses": {
    87          "200": {
    88            "description": "Created Pet response",
    89            "schema": {
    90              "$ref": "#/definitions/Pet"
    91            }
    92          },
    93          "default": {
    94            "description": "Unexpected error",
    95            "schema": {
    96              "$ref": "#/definitions/Error"
    97            }
    98          }
    99        }
   100      }
   101    },
   102    "/pets/{id}": {
   103      "delete": {
   104        "security": [
   105          {
   106            "apiKey": []
   107          }
   108        ],
   109        "description": "Deletes the Pet by id",
   110        "operationId": "deletePet",
   111        "parameters": [
   112          {
   113            "name": "id",
   114            "in": "path",
   115            "description": "ID of pet to delete",
   116            "required": true,
   117            "type": "integer",
   118            "format": "int64"
   119          }
   120        ],
   121        "responses": {
   122          "204": {
   123            "description": "pet deleted"
   124          },
   125          "default": {
   126            "description": "unexpected error",
   127            "schema": {
   128              "$ref": "#/definitions/Error"
   129            }
   130          }
   131        }
   132      },
   133      "get": {
   134        "tags": [ "Pet Operations" ],
   135        "operationId": "getPetById",
   136        "summary": "Finds the pet by id",
   137        "responses": {
   138          "200": {
   139            "description": "Pet response",
   140            "schema": {
   141              "$ref": "#/definitions/Pet"
   142            }
   143          },
   144          "default": {
   145            "description": "Unexpected error",
   146            "schema": {
   147              "$ref": "#/definitions/Error"
   148            }
   149          }
   150        }
   151      },
   152      "parameters": [
   153        {
   154          "name": "id",
   155          "in": "path",
   156          "description": "ID of pet",
   157          "required": true,
   158          "type": "integer",
   159          "format": "int64"
   160        }
   161      ]
   162    }
   163  },
   164  "definitions": {
   165    "Category": {
   166      "id": "Category",
   167      "properties": {
   168        "id": {
   169          "format": "int64",
   170          "type": "integer"
   171        },
   172        "name": {
   173          "type": "string"
   174        }
   175      }
   176    },
   177    "Pet": {
   178      "id": "Pet",
   179      "properties": {
   180        "category": {
   181          "$ref": "#/definitions/Category"
   182        },
   183        "id": {
   184          "description": "unique identifier for the pet",
   185          "format": "int64",
   186          "maximum": 100.0,
   187          "minimum": 0.0,
   188          "type": "integer"
   189        },
   190        "name": {
   191          "type": "string"
   192        },
   193        "photoUrls": {
   194          "items": {
   195            "type": "string"
   196          },
   197          "type": "array"
   198        },
   199        "status": {
   200          "description": "pet status in the store",
   201          "enum": [
   202            "available",
   203            "pending",
   204            "sold"
   205          ],
   206          "type": "string"
   207        },
   208        "tags": {
   209          "items": {
   210            "$ref": "#/definitions/Tag"
   211          },
   212          "type": "array"
   213        }
   214      },
   215      "required": [
   216        "id",
   217        "name"
   218      ]
   219    },
   220    "newPet": {
   221      "allOf": [
   222        {
   223          "$ref": "#/definitions/Pet"
   224        },
   225        {
   226          "required": [
   227            "name"
   228          ]
   229        }
   230      ]
   231    },
   232    "Tag": {
   233      "id": "Tag",
   234      "properties": {
   235        "id": {
   236          "format": "int64",
   237          "type": "integer"
   238        },
   239        "name": {
   240          "type": "string"
   241        }
   242      }
   243    },
   244    "Error": {
   245      "required": [
   246        "code",
   247        "message"
   248      ],
   249      "properties": {
   250        "code": {
   251          "type": "integer",
   252          "format": "int32"
   253        },
   254        "message": {
   255          "type": "string"
   256        }
   257      }
   258    }
   259  },
   260  "consumes": [
   261    "application/json",
   262    "application/xml"
   263  ],
   264  "produces": [
   265    "application/json",
   266    "application/xml",
   267    "text/plain",
   268    "text/html"
   269  ],
   270  "securityDefinitions": {
   271    "basic": {
   272      "type": "basic"
   273    },
   274    "apiKey": {
   275      "type": "apiKey",
   276      "in": "header",
   277      "name": "X-API-KEY"
   278    }
   279  }
   280}

View as plain text