{ "openapi": "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore", "license": { "name": "MIT" } }, "servers": [ { "url": "http://petstore.swagger.io/v1" } ], "paths": { "/pets": { "get": { "summary": "List all pets", "operationId": "listPets", "tags": [ "pets", "petsRead" ], "parameters": [ { "name": "limit", "in": "query", "description": "How many items to return at one time (max 100)", "required": true, "schema": { "type": "integer", "maximum": 100, "format": "int32" } }, { "name": "offset", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "example": 1, "format": "int32" } } ], "responses": { "200": { "description": "A 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" } } } } } }, "post": { "summary": "Add a new pet to the store", "description": "Add a new pet to the store", "operationId": "addPet", "requestBody": { "description": "Create a new pet in the store", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Pet" } }, "text/plain": { "schema": { "type": "string", "example": "10,\"doggie\"" } } }, "required": true }, "responses": { "201": { "description": "Successful operation", "content": { "application/xml": { "schema": { "$ref": "#/components/schemas/Pet" } }, "application/json": { "schema": { "$ref": "#/components/schemas/Pet" } }, "text/plain": { "schema": { "type": "string", "pattern": "^\\d+,\\d+$", "maxLength": 100, "example": "10,\"doggie\"", "minLength": 4 } } } }, "405": { "description": "Invalid input" } }, "security": [ { "petstore_auth": [ "write:pets", "read:pets" ] } ] }, "patch": { "summary": "Update a pet", "description": "Update a pet in the pet store", "operationId": "updatePet", "requestBody": { "description": "Update a pet in the store", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Pet" } } }, "required": true }, "responses": { "200": { "description": "Successful operation", "content": { "application/xml": { "schema": { "$ref": "#/components/schemas/Pet" } }, "application/json": { "schema": { "$ref": "#/components/schemas/Pet" } } } }, "405": { "description": "Invalid input" } }, "security": [ { "petstore_auth": [ "write:pets", "read:pets" ] } ] } }, "/pets/{petId}": { "post": { "summary": "Create with ID (not implemented)", "operationId": "createPetById", "tags": [ "pets" ], "parameters": [ { "name": "petId", "in": "path", "required": true, "description": "The id of the pet to retrieve", "schema": { "example": "id_11", "type": "string" } } ], "responses": { "501": { "description": "Not implemented error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } }, "text/plain": { "schema": { "type": "string", "example": "Not implemented" } } } } } }, "get": { "summary": "Info for a specific pet", "operationId": "showPetById", "tags": [ "pets", "petsRead" ], "parameters": [ { "name": "petId", "in": "path", "required": true, "description": "The id of the pet to retrieve", "schema": { "type": "integer", "example": 22 } } ], "responses": { "200": { "description": "Expected response to a valid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Pet" } } } }, "default": { "description": "unexpected error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } } }, "components": { "schemas": { "Pet": { "required": [ "id", "name", "inner", "photo_urls" ], "properties": { "id": { "type": "integer", "format": "int64" }, "name": { "type": "string" }, "tag": { "type": "string" }, "some_arr_with_no_type": { "items": { "type": "string" } }, "photo_urls": { "type": "array", "items": { "type": "string" }, "example": [ "https://example.com/img.png", "https://example.com/img2.png" ] }, "inner": { "type": "object", "required": [ "test" ], "allOf": [ { "properties": { "test": { "type": "string" } } } ] } } }, "Pets": { "type": "array", "maxItems": 100, "items": { "$ref": "#/components/schemas/Pet" } }, "Error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "integer", "format": "int32" }, "message": { "type": "string" } } } } } }