{ "openapi": "3.0.1", "info": { "title": "swagger", "version": "v1" }, "servers": [ { "url": "/api" } ], "paths": { "/api/v{api-version}/simple": { "get": { "tags": [ "Simple" ], "operationId": "GetCallWithoutParametersAndResponse" }, "put": { "tags": [ "Simple" ], "operationId": "PutCallWithoutParametersAndResponse" }, "post": { "tags": [ "Simple" ], "operationId": "PostCallWithoutParametersAndResponse" }, "delete": { "tags": [ "Simple" ], "operationId": "DeleteCallWithoutParametersAndResponse" }, "options": { "tags": [ "Simple" ], "operationId": "OptionsCallWithoutParametersAndResponse" }, "head": { "tags": [ "Simple" ], "operationId": "HeadCallWithoutParametersAndResponse" }, "patch": { "tags": [ "Simple" ], "operationId": "PatchCallWithoutParametersAndResponse" } }, "/api/v{api-version}/parameters": { "get": { "tags": [ "Parameters" ], "operationId": "CallWithParameters", "parameters": [ { "description": "This is the parameter that goes into the request header", "name": "parameterHeader", "in": "header", "required": true, "nullable": true, "schema": { "type": "string" } }, { "description": "This is the parameter that goes into the request query params", "name": "parameterQuery", "in": "query", "required": true, "nullable": true, "schema": { "type": "string" } }, { "description": "This is the parameter that goes into the request form data", "name": "parameterForm", "in": "formData", "required": true, "nullable": true, "schema": { "type": "string" } }, { "description": "This is the parameter that goes into the cookie", "name": "parameterCookie", "in": "cookie", "required": true, "nullable": true, "schema": { "type": "string" } }, { "name": "api-version", "in": "path", "required": true, "nullable": true, "schema": { "type": "string" } } ], "requestBody": { "description": "This is the parameter that goes into the body", "content": { "application/json": { "description": "Message for default response", "schema": { "$ref": "#/components/schemas/ModelWithString" } } } } } }, "/api/v{api-version}/defaults": { "get": { "tags": [ "Defaults" ], "operationId": "CallWithDefaultParameters", "parameters": [ { "description": "This is a simple string", "name": "parameterString", "in": "query", "nullable": true, "schema": { "type": "string", "default": "Hello World!" } }, { "description": "This is a simple number", "name": "parameterNumber", "in": "query", "nullable": true, "schema": { "type": "number", "default": 123 } }, { "description": "This is a simple boolean", "name": "parameterBoolean", "in": "query", "nullable": true, "schema": { "type": "boolean", "default": true } }, { "description": "This is a simple enum", "name": "parameterEnum", "in": "query", "schema": { "enum": [ "Success", "Warning", "Error" ], "default": 0 } }, { "description": "This is a simple model", "name": "parameterModel", "in": "query", "nullable": true, "schema": { "$ref": "#/components/schemas/ModelWithString", "default": { "prop": "Hello World" } } } ] } }, "/api/v{api-version}/response": { "get": { "tags": [ "Response" ], "operationId": "CallWithResponse", "responses": { "default": { "content": { "application/json": { "description": "Message for default response", "schema": { "$ref": "#/components/schemas/ModelWithString" } } } } } }, "post": { "tags": [ "Response" ], "operationId": "CallWithDuplicateResponses", "responses": { "default": { "description": "Message for default response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ModelWithString" } } } }, "201": { "description": "Message for 201 response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ModelWithString" } } } }, "202": { "description": "Message for 202 response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ModelWithString" } } } }, "500": { "description": "Message for 500 error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ModelWithString" } } } }, "501": { "description": "Message for 501 error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ModelWithString" } } } }, "502": { "description": "Message for 502 error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ModelWithString" } } } } } }, "put": { "tags": [ "Response" ], "operationId": "CallWithResponses", "responses": { "default": { "description": "Message for default response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ModelWithString" } } } }, "201": { "description": "Message for 201 response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ModelThatExtends" } } } }, "202": { "description": "Message for 202 response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ModelThatExtendsExtends" } } } }, "500": { "description": "Message for 500 error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ModelWithString" } } } }, "501": { "description": "Message for 501 error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ModelWithString" } } } }, "502": { "description": "Message for 502 error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ModelWithString" } } } } } } }, "/api/v{api-version}/types": { "get": { "tags": [ "Types" ], "operationId": "Types", "parameters": [ { "description": "This is a number parameter", "name": "parameterNumber", "in": "query", "required": true, "schema": { "type": "int", "default": 123 } }, { "description": "This is a string parameter", "name": "parameterString", "in": "query", "required": true, "nullable": true, "schema": { "type": "string", "default": "default" } }, { "description": "This is a boolean parameter", "name": "parameterBoolean", "in": "query", "required": true, "nullable": true, "schema": { "type": "boolean", "default": true } }, { "description": "This is an object parameter", "name": "parameterObject", "in": "query", "required": true, "nullable": true, "schema": { "type": "object", "default": null } }, { "description": "This is an array parameter", "name": "parameterArray", "in": "query", "required": true, "nullable": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "description": "This is a dictionary parameter", "name": "parameterDictionary", "in": "query", "required": true, "nullable": true, "schema": { "type": "object", "items": { "type": "string" } } }, { "description": "This is an enum parameter", "name": "parameterEnum", "in": "query", "required": true, "nullable": true, "schema": { "enum": [ "Success", "Warning", "Error" ] } }, { "description": "This is a number parameter", "name": "id", "in": "path", "schema": { "type": "integer", "format": "int32" } } ], "responses": { "200": { "description": "Response is a simple number", "content": { "application/json": { "schema": { "type": "number" } } } }, "201": { "description": "Response is a simple string", "content": { "application/json": { "schema": { "type": "string" } } } }, "202": { "description": "Response is a simple boolean", "content": { "application/json": { "schema": { "type": "boolean" } } } }, "203": { "description": "Response is a simple object", "content": { "application/json": { "schema": { "type": "object" } } } } } } }, "/api/v{api-version}/complex": { "get": { "tags": [ "Complex" ], "operationId": "ComplexTypes", "parameters": [ { "description": "Parameter containing object", "name": "parameterObject", "in": "query", "required": true, "schema": { "type": "object", "properties": { "first": { "type": "object", "properties": { "second": { "type": "object", "properties": { "third": { "type": "string" } } } } } } } }, { "description": "Parameter containing reference", "name": "parameterReference", "in": "query", "required": true, "schema": { "$ref": "#/components/schemas/ModelWithString" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ModelWithString" } } } } }, "400": { "description": "400 server error" }, "500": { "description": "500 server error" } } } } }, "components": { "schemas": { "SimpleInteger": { "description": "This is a simple number", "type": "integer" }, "SimpleBoolean": { "description": "This is a simple boolean", "type": "boolean" }, "SimpleString": { "description": "This is a simple string", "type": "string" }, "SimpleFile": { "description": "This is a simple file", "type": "File" }, "SimpleReference": { "description": "This is a simple reference", "$ref": "#/components/schemas/ModelWithString" }, "EnumWithStrings": { "description": "This is a simple enum with strings", "enum": [ "Success", "Warning", "Error" ] }, "EnumWithNumbers": { "description": "This is a simple enum with numbers", "enum": [ 1, 2, 3 ] }, "EnumFromDescription": { "description": "Success=1,Warning=2,Error=3", "type": "int" }, "ArrayWithNumbers": { "description": "This is a simple array with numbers", "type": "array", "items": { "type": "integer" } }, "ArrayWithBooleans": { "description": "This is a simple array with booleans", "type": "array", "items": { "type": "boolean" } }, "ArrayWithStrings": { "description": "This is a simple array with strings", "type": "array", "items": { "type": "string" } }, "ArrayWithReferences": { "description": "This is a simple array with references", "type": "array", "items": { "$ref": "#/components/schemas/ModelWithString" } }, "ArrayWithArray": { "description": "This is a simple array containing an array", "type": "array", "items": { "type": "array", "items": { "$ref": "#/components/schemas/ModelWithString" } } }, "ArrayWithProperties": { "description": "This is a simple array with properties", "type": "array", "items": { "type": "object", "properties": { "foo": { "type": "string" }, "bar": { "type": "string" } } } }, "DictionaryWithString": { "description": "This is a string dictionary", "type": "object", "additionalProperties": { "type": "string" } }, "DictionaryWithReference": { "description": "This is a string reference", "type": "object", "additionalProperties": { "$ref": "#/components/schemas/ModelWithString" } }, "DictionaryWithArray": { "description": "This is a complex dictionary", "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/components/schemas/ModelWithString" } } }, "DictionaryWithDictionary": { "description": "This is a string dictionary", "type": "object", "additionalProperties": { "type": "object", "additionalProperties": { "type": "string" } } }, "DictionaryWithProperties": { "description": "This is a complex dictionary", "type": "object", "additionalProperties": { "type": "object", "properties": { "foo": { "type": "string" }, "bar": { "type": "string" } } } }, "ModelWithInteger": { "description": "This is a model with one number property", "type": "object", "properties": { "prop": { "description": "This is a simple number property", "type": "integer" } } }, "ModelWithBoolean": { "description": "This is a model with one boolean property", "type": "object", "properties": { "prop": { "description": "This is a simple boolean property", "type": "boolean" } } }, "ModelWithString": { "description": "This is a model with one string property", "type": "object", "properties": { "prop": { "description": "This is a simple string property", "type": "string" } } }, "ModelWithEnum": { "description": "This is a model with one enum", "type": "object", "properties": { "Test": { "description": "This is a simple enum with strings", "enum": [ "Success", "Warning", "Error" ] } } }, "ModelWithEnumFromDescription": { "description": "This is a model with one enum", "type": "object", "properties": { "Test": { "type": "integer", "description": "Success=1,Warning=2,Error=3" } } }, "ModelWithNestedEnums": { "description": "This is a model with nested enums", "type": "object", "properties": { "dictionaryWithEnum": { "type": "object", "additionalProperties": { "enum": [ "Success", "Warning", "Error" ] } }, "dictionaryWithEnumFromDescription": { "type": "object", "additionalProperties": { "type": "integer", "description": "Success=1,Warning=2,Error=3" } }, "arrayWithEnum": { "type": "array", "items": { "enum": [ "Success", "Warning", "Error" ] } }, "arrayWithDescription": { "type": "array", "items": { "type": "integer", "description": "Success=1,Warning=2,Error=3" } } } }, "ModelWithReference": { "description": "This is a model with one property containing a reference", "type": "object", "properties": { "prop": { "$ref": "#/components/schemas/ModelWithString" } } }, "ModelWithArray": { "description": "This is a model with one property containing an array", "type": "object", "properties": { "prop": { "type": "array", "items": { "$ref": "#/components/schemas/ModelWithString" } }, "propWithFile": { "type": "array", "items": { "type": "File" } }, "propWithNumber": { "type": "array", "items": { "type": "int" } } } }, "ModelWithDictionary": { "description": "This is a model with one property containing a dictionary", "type": "object", "properties": { "prop": { "type": "object", "additionalProperties": { "type": "string" } } } }, "ModelLink": { "description": "This is a model that can have a template??", "type": "object", "properties": { "id": { "type": "string" } } }, "ModelWithLink": { "description": "This is a model that can have a template??", "type": "object", "properties": { "prop": { "$ref": "#/components/schemas/ModelLink[ModelWithString]" } } }, "ModelWithCircularReference": { "description": "This is a model with one property containing a circular reference", "type": "object", "properties": { "prop": { "$ref": "#/components/schemas/ModelWithCircularReference" } } }, "ModelWithProperties": { "description": "This is a model with one nested property", "type": "object", "required": [ "required", "requiredAndReadOnly", "requiredAndNullable" ], "properties": { "required": { "type": "string" }, "requiredAndReadOnly": { "type": "string", "readOnly": true }, "requiredAndNullable": { "type": "string", "nullable": true }, "string": { "type": "string" }, "number": { "type": "number" }, "boolean": { "type": "boolean" }, "reference": { "$ref": "#/components/schemas/ModelWithString" } } }, "ModelWithNestedProperties": { "description": "This is a model with one nested property", "type": "object", "required": [ "first" ], "properties": { "first": { "type": "object", "required": [ "second" ], "readOnly": true, "nullable": true, "properties": { "second": { "type": "object", "required": [ "third" ], "readOnly": true, "nullable": true, "properties": { "third": { "type": "string", "required": true, "readOnly": true, "nullable": true } } } } } } }, "ModelWithDuplicateProperties": { "description": "This is a model with duplicated properties", "type": "object", "properties": { "prop": { "$ref": "#/components/schemas/ModelWithString" }, "prop": { "$ref": "#/components/schemas/ModelWithString" }, "prop": { "$ref": "#/components/schemas/ModelWithString" } } }, "ModelWithDuplicateImports": { "description": "This is a model with duplicated imports", "type": "object", "properties": { "propA": { "$ref": "#/components/schemas/ModelWithString" }, "propB": { "$ref": "#/components/schemas/ModelWithString" }, "propC": { "$ref": "#/components/schemas/ModelWithString" } } }, "ModelThatExtends": { "description": "This is a model that extends another model", "type": "object", "allOf": [ { "$ref": "#/components/schemas/ModelWithString" }, { "type": "object", "properties": { "propExtendsA": { "type": "string" }, "propExtendsB": { "$ref": "#/components/schemas/ModelWithString" } } } ] }, "ModelThatExtendsExtends": { "description": "This is a model that extends another model", "type": "object", "allOf": [ { "$ref": "#/components/schemas/ModelWithString" }, { "$ref": "#/components/schemas/ModelThatExtends" }, { "type": "object", "properties": { "propExtendsC": { "type": "string" }, "propExtendsD": { "$ref": "#/components/schemas/ModelWithString" } } } ] } } } }