...

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

Documentation: github.com/go-openapi/validate/fixtures/go-swagger/petstores

     1{
     2  "swagger": "2.0",
     3  "info": {
     4    "version": "1.0.0",
     5    "title": "Swagger Petstore",
     6    "description": "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification",
     7    "termsOfService": "http://helloreverb.com/terms/",
     8    "contact": {
     9      "name": "Wordnik API Team"
    10    },
    11    "license": {
    12      "name": "MIT"
    13    }
    14  },
    15  "host": "petstore.swagger.wordnik.com",
    16  "basePath": "/api",
    17  "schemes": [
    18    "http"
    19  ],
    20  "consumes": [
    21    "application/json"
    22  ],
    23  "produces": [
    24    "application/json"
    25  ],
    26  "paths": {
    27    "/pets": {
    28      "get": {
    29        "description": "Returns all pets from the system that the user has access to",
    30        "operationId": "findPets",
    31        "produces": [
    32          "application/json",
    33          "application/xml",
    34          "text/xml",
    35          "text/html"
    36        ],
    37        "parameters": [
    38          {
    39            "name": "tags",
    40            "in": "query",
    41            "description": "tags to filter by",
    42            "required": false,
    43            "type": "array",
    44            "items": {
    45              "type": "string"
    46            },
    47            "collectionFormat": "csv"
    48          },
    49          {
    50            "name": "limit",
    51            "in": "query",
    52            "description": "maximum number of results to return",
    53            "required": false,
    54            "type": "integer",
    55            "format": "int32"
    56          }
    57        ],
    58        "responses": {
    59          "200": {
    60            "description": "pet response",
    61            "schema": {
    62              "type": "array",
    63              "items": {
    64                "$ref": "#/definitions/pet"
    65              }
    66            }
    67          },
    68          "default": {
    69            "description": "unexpected error",
    70            "schema": {
    71              "$ref": "#/definitions/errorModel"
    72            }
    73          }
    74        }
    75      },
    76      "post": {
    77        "description": "Creates a new pet in the store.  Duplicates are allowed",
    78        "operationId": "addPet",
    79        "produces": [
    80          "application/json"
    81        ],
    82        "parameters": [
    83          {
    84            "name": "pet",
    85            "in": "body",
    86            "description": "Pet to add to the store",
    87            "required": true,
    88            "schema": {
    89              "$ref": "#/definitions/petInput"
    90            }
    91          }
    92        ],
    93        "responses": {
    94          "200": {
    95            "description": "pet response",
    96            "schema": {
    97              "$ref": "#/definitions/pet"
    98            }
    99          },
   100          "default": {
   101            "description": "unexpected error",
   102            "schema": {
   103              "$ref": "#/definitions/errorModel"
   104            }
   105          }
   106        }
   107      }
   108    },
   109    "/pets/{id}": {
   110      "get": {
   111        "description": "Returns a user based on a single ID, if the user does not have access to the pet",
   112        "operationId": "findPetById",
   113        "produces": [
   114          "application/json",
   115          "application/xml",
   116          "text/xml",
   117          "text/html"
   118        ],
   119        "parameters": [
   120          {
   121            "name": "id",
   122            "in": "path",
   123            "description": "ID of pet to fetch",
   124            "required": true,
   125            "type": "integer",
   126            "format": "int64"
   127          }
   128        ],
   129        "responses": {
   130          "200": {
   131            "description": "pet response",
   132            "schema": {
   133              "$ref": "#/definitions/pet"
   134            }
   135          },
   136          "default": {
   137            "description": "unexpected error",
   138            "schema": {
   139              "$ref": "#/definitions/errorModel"
   140            }
   141          }
   142        }
   143      },
   144      "delete": {
   145        "description": "deletes a single pet based on the ID supplied",
   146        "operationId": "deletePet",
   147        "parameters": [
   148          {
   149            "name": "id",
   150            "in": "path",
   151            "description": "ID of pet to delete",
   152            "required": true,
   153            "type": "integer",
   154            "format": "int64"
   155          }
   156        ],
   157        "responses": {
   158          "204": {
   159            "description": "pet deleted"
   160          },
   161          "default": {
   162            "description": "unexpected error",
   163            "schema": {
   164              "$ref": "#/definitions/errorModel"
   165            }
   166          }
   167        }
   168      }
   169    }
   170  },
   171  "definitions": {
   172    "pet": {
   173      "required": [
   174        "id",
   175        "name"
   176      ],
   177      "properties": {
   178        "id": {
   179          "type": "integer",
   180          "format": "int64"
   181        },
   182        "name": {
   183          "type": "string"
   184        },
   185        "tag": {
   186          "type": "string"
   187        }
   188      }
   189    },
   190    "petInput": {
   191      "allOf": [
   192        {
   193          "$ref": "pet"
   194        },
   195        {
   196          "required": [
   197            "name"
   198          ],
   199          "properties": {
   200            "id": {
   201              "type": "integer",
   202              "format": "int64"
   203            }
   204          }
   205        }
   206      ]
   207    },
   208    "errorModel": {
   209      "required": [
   210        "code",
   211        "message"
   212      ],
   213      "properties": {
   214        "code": {
   215          "type": "integer",
   216          "format": "int32"
   217        },
   218        "message": {
   219          "type": "string"
   220        }
   221      }
   222    }
   223  }
   224}

View as plain text