{
	"openapi": "3.0.0",
	"info": {
		"version": "1.0.0",
		"title": "Swagger Petstore",
		"license": {
			"name": "MIT"
		}
	},
	"servers": [
		{
            "url": "http://petstore.swagger.io/{v1}",
            "variables":{
                "v1": {
					"default":"v2.0",
					"enum":["v2.0","v2.1","v2.2","v2.3"],
					"description":"version number"
                }
            }

		}
	],
	"paths": {
		"/pets": {
			"get": {
				"summary": "List all pets",
				"operationId": "listPets",
				"tags": [
					"pets"
				],
				"parameters": [
					{
						"$ref":"#/components/parameters/queryparam1"
					},
					{
						"name": "variable",
						"in": "header",
						"description": "random variable",
						"style": "simple",
						"explode": false,
						"schema": {
							"type": "array",
							"items": {
								"type": "string"
							}
						}
					},
					{
						"name": "variable2",
						"in": "query",
						"description": "another random variable",
						"style": "spaceDelimited",
						"schema": {
							"type": "array",
							"items": {
								"type": "integer",
								"format": "int64"
							}
						}
					}
				],
				"responses": {
					"200": {
						"description": "An paged array of pets",
						"headers": {
							"x-next": {
								"description": "A link to the next page of responses",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Pets"
								}
							}
						}
					},
					"default": {
						"description": "unexpected error",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								}
							}
						}
					}
				},
				"servers": [
					{
						"url": "http://petstore3.swagger.io/{v3}",
						"variables": {
							"v3": {
								"default":"v6.0",
								"enum": ["v4.0", "v5.0", "v6.0"],
								"description" : "version number"
							}
						}
					}
				]
			},
			"post": {
				"tags": [
					"pets"
                ],
                "requestBody":{
                    "$ref": "#/components/requestBodies/body1"
                },
				"responses": {
					"201": {
						"description": "Null response"
					},
					"default": {
						"description": "unexpected error",
						"headers":{
							"X-Rate-Limit-Limit":{
								"$ref":"#/components/headers/header1"
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								}
							}
						}
					}
				}
			},
			"servers": [
				{
                    "url": "http://petstore2.swagger.io/{v2}",
                    "variables":{
                        "v2": {
                            "default":"v3.0"
                        }
                    }
				}
			],
			"parameters":[
        {
				  "$ref":"#/components/parameters/queryparam1"
        },
            {
                "name": "variable3",
                "in": "query",
                "description": "another random variable",
                "style": "spaceDelimited",
                "schema": {
                    "type": "array",
                    "items": {
                        "type": "integer",
                        "format": "int64"
                    }
                }
            }]
		},
		"/pet/{petId}": {
			"get": {
				"operationId": "showPetById",
				"tags": [
					"pets"
				],
				"parameters": [
					{
						"name": "petId",
						"in": "path",
						"required": true,
						"description": "The id of the pet to retrieve",
						"schema": {
							"type": "string"
						}
					}
				],
				"responses": {
					"200": {
						"description": "Expected response to a valid request",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Pets"
								}
							}
						}
					},
					"default": {
						"description": "unexpected error",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								}
							}
						}
					}
				}
			},
			"post": {
				"summary": "Info for a specific pet",
				"operationId": "showPetById",
				"tags": [
					"pets"
				],
				"parameters": [
					{
						"name": "petId",
						"in": "path",
						"required": true,
						"description": "The id of the pet to retrieve",
						"schema": {
							"type": "string"
						}
					}
				],
				"responses": {
					"200": {
						"$ref":"#/components/responses/response2"
					},
					"default": {
						"description": "unexpected error",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								}
							}
						}
					}
				}
			}
		}
	},
	"components": {
		"schemas": {
			"Pet": {
				"required": [
					"id",
					"name"
				],
				"properties": {
					"id": {
						"type": "integer",
						"format": "int64"
					},
					"name": {
						"type": "string"
					},
					"tag": {
						"type": "string"
					}
				}
			},
			"Pets": {
				"type": "array",
				"items": {
					"$ref": "#/components/schemas/Pet"
				}
			},
			"Error": {
				"required": [
					"code",
					"message"
				],
				"properties": {
					"code": {
						"type": "integer",
						"format": "int32"
					},
					"message": {
						"type": "string"
					}
				}
			}
    },
    "parameters": {
      "queryparam1": {
				"name": "limit",
				"in": "query",
				"description": "component level query param",
				"required": false,
				"schema": {
					"type": "string"
				}
			}
        },
		"responses": {
			"response1":{
				"description": "Expected response to a valid request",
				"content": {
					"application/json": {
						"schema": {
							"$ref": "#/components/schemas/Pets"
						}
					}
				}
			},
			"response2":{
				"$ref": "#/components/responses/response1"
			}
		},
		"requestBodies": {
            "body1": {
                "description": "here comes request body",
                "content": {
                    "text/plain":{
                        "example":{
                            "value": "request body comes here"
                        }
                    }
                }
            }
        },
        "securitySchemes":{
            "api_key": {
                "type": "apiKey",
                "name": "api_key",
                "in": "query"
            },
            "petstore_auth": {
                "type": "oauth2",
                "flows": {
                    "implicit": {
                        "authorizationUrl": "http://example.org/api/oauth/dialog",
                        "scopes": {
                            "write:pets": "modify pets in your account",
                            "read:pets": "read your pets"
                        }
                    }
                }
            },
            "basic_http": {
                "type": "http",
                "scheme": "basic"
            }
		},
		"headers":{
			"header1": {
				"description": "The number of allowed requests in the current period",
				"schema": {
				  "type": "integer"
				}
			  }
		}
    },
    "security":[
        {
            "petstore_auth":[]
        },
        {
            "basic_http":[]
        },
        {
            "api_key":[]
        }
    ]
}
