{ "swagger": "2.0", "info": { "title": "swagger", "version": "v1.0" }, "host": "localhost:3000", "basePath": "/base", "schemes": [ "http" ], "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/{parameterPath}": { "get": { "tags": [ "Parameters" ], "operationId": "CallWithParameters", "parameters": [ { "description": "This is the parameter that goes into the header", "name": "parameterHeader", "in": "header", "type": "string", "required": true }, { "description": "This is the parameter that goes into the query params", "name": "parameterQuery", "in": "query", "type": "string", "required": true }, { "description": "This is the parameter that goes into the form data", "name": "parameterForm", "in": "formData", "type": "string", "required": true }, { "description": "This is the parameter that is send as request body", "name": "parameterBody", "in": "body", "type": "string", "required": true }, { "description": "This is the parameter that goes into the path", "name": "parameterPath", "in": "path", "type": "string", "required": true }, { "name": "api-version", "in": "path", "type": "string", "required": true } ] } }, "/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}": { "get": { "tags": [ "Parameters" ], "operationId": "CallWithWeirdParameterNames", "parameters": [ { "description": "This is the parameter that goes into the path", "name": "parameter.path.1", "in": "path", "type": "string", "required": false }, { "description": "This is the parameter that goes into the path", "name": "parameter-path-2", "in": "path", "type": "string", "required": false }, { "description": "This is the parameter that goes into the path", "name": "PARAMETER-PATH-3", "in": "path", "type": "string", "required": false }, { "description": "This is the parameter that goes into the request header", "name": "parameter.header", "in": "header", "type": "string", "required": true }, { "description": "This is the parameter that goes into the request query params", "name": "parameter-query", "in": "query", "type": "string", "required": true }, { "description": "This is the parameter that goes into the request form data", "name": "parameter_form", "in": "formData", "type": "string", "required": true }, { "description": "This is the parameter that is send as request body", "name": "PARAMETER-BODY", "in": "body", "type": "string", "required": true }, { "name": "api-version", "in": "path", "type": "string", "required": true } ] } }, "/api/v{api-version}/defaults": { "get": { "tags": [ "Defaults" ], "operationId": "CallWithDefaultParameters", "parameters": [ { "description": "This is a simple string with default value", "name": "parameterString", "in": "query", "required": true, "default": "Hello World!", "type": "string" }, { "description": "This is a simple number with default value", "name": "parameterNumber", "in": "query", "required": true, "default": 123, "type": "number" }, { "description": "This is a simple boolean with default value", "name": "parameterBoolean", "in": "query", "required": true, "default": true, "type": "boolean" }, { "description": "This is a simple enum with default value", "name": "parameterEnum", "in": "query", "required": true, "default": 0, "schema": { "enum": [ "Success", "Warning", "Error" ] } }, { "description": "This is a simple model with default value", "name": "parameterModel", "in": "query", "required": true, "default": { "prop": "Hello World!" }, "schema": { "$ref": "#/definitions/ModelWithString" } } ] }, "post": { "tags": [ "Defaults" ], "operationId": "CallWithDefaultOptionalParameters", "parameters": [ { "description": "This is a simple string that is optional with default value", "name": "parameterString", "in": "query", "default": "Hello World!", "type": "string" }, { "description": "This is a simple number that is optional with default value", "name": "parameterNumber", "in": "query", "default": 123, "type": "number" }, { "description": "This is a simple boolean that is optional with default value", "name": "parameterBoolean", "in": "query", "default": true, "type": "boolean" }, { "description": "This is a simple enum that is optional with default value", "name": "parameterEnum", "in": "query", "default": 0, "schema": { "enum": [ "Success", "Warning", "Error" ] } }, { "description": "This is a simple model that is optional with default value", "name": "parameterModel", "in": "query", "default": { "prop": "Hello World!" }, "schema": { "$ref": "#/definitions/ModelWithString" } } ] }, "put": { "tags": [ "Defaults" ], "operationId": "CallToTestOrderOfParams", "parameters": [ { "description": "This is a optional string with default", "name": "parameterOptionalStringWithDefault", "in": "query", "required": false, "default": "Hello World!", "type": "string" }, { "description": "This is a optional string with empty default", "name": "parameterOptionalStringWithEmptyDefault", "in": "query", "required": false, "default": "", "type": "string" }, { "description": "This is a optional string with no default", "name": "parameterOptionalStringWithNoDefault", "in": "query", "required": false, "type": "string" }, { "description": "This is a string with default", "name": "parameterStringWithDefault", "in": "query", "required": true, "default": "Hello World!", "type": "string" }, { "description": "This is a string with empty default", "name": "parameterStringWithEmptyDefault", "in": "query", "required": true, "default": "", "type": "string" }, { "description": "This is a string with no default", "name": "parameterStringWithNoDefault", "in": "query", "required": true, "type": "string" } ] } }, "/api/v{api-version}/duplicate": { "get": { "tags": [ "Duplicate" ], "operationId": "DuplicateName" }, "post": { "tags": [ "Duplicate" ], "operationId": "DuplicateName" }, "put": { "tags": [ "Duplicate" ], "operationId": "DuplicateName" }, "delete": { "tags": [ "Duplicate" ], "operationId": "DuplicateName" } }, "/api/v{api-version}/response": { "get": { "tags": [ "Response" ], "operationId": "CallWithResponse", "responses": { "default": { "description": "Message for default response", "schema": { "$ref": "#/definitions/ModelWithString" } } } }, "post": { "tags": [ "Response" ], "operationId": "CallWithDuplicateResponses", "responses": { "default": { "description": "Message for default response", "schema": { "$ref": "#/definitions/ModelWithString" } }, "201": { "description": "Message for 201 response", "schema": { "$ref": "#/definitions/ModelWithString" } }, "202": { "description": "Message for 202 response", "schema": { "$ref": "#/definitions/ModelWithString" } }, "500": { "description": "Message for 500 error", "schema": { "$ref": "#/definitions/ModelWithString" } }, "501": { "description": "Message for 501 error", "schema": { "$ref": "#/definitions/ModelWithString" } }, "502": { "description": "Message for 502 error", "schema": { "$ref": "#/definitions/ModelWithString" } } } }, "put": { "tags": [ "Response" ], "operationId": "CallWithResponses", "responses": { "default": { "description": "Message for default response", "schema": { "$ref": "#/definitions/ModelWithString" } }, "200": { "description": "Message for 200 response", "schema": { "type": "object", "properties": { "@namespace.string": { "type": "string", "readOnly": true }, "@namespace.integer": { "type": "integer", "readOnly": true }, "value": { "type": "array", "items": { "$ref": "#/definitions/ModelWithString" }, "readOnly": true } } } }, "201": { "description": "Message for 201 response", "schema": { "$ref": "#/definitions/ModelThatExtends" } }, "202": { "description": "Message for 202 response", "schema": { "$ref": "#/definitions/ModelThatExtendsExtends" } }, "500": { "description": "Message for 500 error", "schema": { "$ref": "#/definitions/ModelWithString" } }, "501": { "description": "Message for 501 error", "schema": { "$ref": "#/definitions/ModelWithString" } }, "502": { "description": "Message for 502 error", "schema": { "$ref": "#/definitions/ModelWithString" } } } } }, "/api/v{api-version}/types": { "get": { "tags": [ "Types" ], "operationId": "Types", "parameters": [ { "description": "This is a number parameter", "name": "parameterNumber", "in": "query", "required": true, "default": 123, "type": "int" }, { "description": "This is a string parameter", "name": "parameterString", "in": "query", "required": true, "default": "default", "type": "string" }, { "description": "This is a boolean parameter", "name": "parameterBoolean", "in": "query", "required": true, "default": true, "type": "boolean" }, { "description": "This is an object parameter", "name": "parameterObject", "in": "query", "required": true, "default": null, "type": "object" }, { "description": "This is an array parameter", "name": "parameterArray", "in": "query", "required": true, "type": "array", "items": { "type": "string" } }, { "description": "This is a dictionary parameter", "name": "parameterDictionary", "in": "query", "required": true, "type": "object", "items": { "type": "string" } }, { "description": "This is an enum parameter", "name": "parameterEnum", "in": "query", "required": 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", "schema": { "type": "number" } }, "201": { "description": "Response is a simple string", "schema": { "type": "string" } }, "202": { "description": "Response is a simple boolean", "schema": { "type": "boolean" } }, "203": { "description": "Response is a simple object", "default": null, "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": "#/definitions/ModelWithString" } } ], "responses": { "200": { "description": "Successful response", "schema": { "type": "array", "items": { "$ref": "#/definitions/ModelWithString" } } }, "400": { "description": "400 server error" }, "500": { "description": "500 server error" } } } }, "/api/v{api-version}/header": { "post": { "tags": [ "Header" ], "operationId": "CallWithResultFromHeader", "responses": { "200": { "description": "Successful response", "headers": { "operation-location": { "type": "string" } } }, "400": { "description": "400 server error" }, "500": { "description": "500 server error" } } } } }, "definitions": { "MultilineComment": { "description": "Testing multiline comments.\nThis must go to the next line.\n\nThis will contain a break.", "type": "integer" }, "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": "#/definitions/ModelWithString" }, "SimpleStringWithPattern": { "description": "This is a simple string", "type": "string", "maxLength": 64, "pattern": "^[a-zA-Z0-9_]*$" }, "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" }, "EnumWithExtensions": { "description": "This is a simple enum with numbers", "enum": [ 200, 400, 500 ], "x-enum-varnames": [ "CUSTOM_SUCCESS", "CUSTOM_WARNING", "CUSTOM_ERROR" ], "x-enum-descriptions": [ "Used when the status of something is successful", "Used when the status of something has a warning", "Used when the status of something has an error" ] }, "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": "#/definitions/ModelWithString" } }, "ArrayWithArray": { "description": "This is a simple array containing an array", "type": "array", "items": { "type": "array", "items": { "$ref": "#/definitions/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": "#/definitions/ModelWithString" } }, "DictionaryWithArray": { "description": "This is a complex dictionary", "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/definitions/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" } } } }, "Date": { "description": "This is a type-only model that defines Date as a string", "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" } } }, "ModelWithNullableString": { "description": "This is a model with one string property", "type": "object", "required": [ "nullableRequiredProp" ], "properties": { "nullableProp": { "description": "This is a simple string property", "type": "string", "x-nullable": true }, "nullableRequiredProp": { "description": "This is a simple string property", "type": "string", "x-nullable": true } } }, "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" ] }, "statusCode": { "description": "These are the HTTP error code enums", "enum": [ "100", "200 FOO", "300 FOO_BAR", "400 foo-bar", "500 foo.bar", "600 foo&bar" ] } } }, "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": "#/definitions/ModelWithProperties" } } }, "ModelWithArray": { "description": "This is a model with one property containing an array", "type": "object", "properties": { "prop": { "type": "array", "items": { "$ref": "#/definitions/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" } } } }, "ModelWithCircularReference": { "description": "This is a model with one property containing a circular reference", "type": "object", "properties": { "prop": { "$ref": "#/definitions/ModelWithCircularReference" } } }, "ModelWithProperties": { "description": "This is a model with one nested property", "type": "object", "required": [ "required", "requiredAndReadOnly" ], "properties": { "required": { "type": "string" }, "requiredAndReadOnly": { "type": "string", "readOnly": true }, "string": { "type": "string" }, "number": { "type": "number" }, "boolean": { "type": "boolean" }, "reference": { "$ref": "#/definitions/ModelWithString" }, "@namespace.string": { "type": "string", "readOnly": true }, "@namespace.integer": { "type": "integer", "readOnly": true } } }, "ModelWithNestedProperties": { "description": "This is a model with one nested property", "type": "object", "required": [ "first" ], "properties": { "first": { "type": "object", "required": [ "second" ], "readOnly": true, "properties": { "second": { "type": "object", "required": [ "third" ], "readOnly": true, "properties": { "third": { "type": "string", "readOnly": true } } } } } } }, "ModelWithDuplicateProperties": { "description": "This is a model with duplicated properties", "type": "object", "properties": { "prop": { "$ref": "#/definitions/ModelWithString" }, "prop": { "$ref": "#/definitions/ModelWithString" }, "prop": { "$ref": "#/definitions/ModelWithString" } } }, "ModelWithOrderedProperties": { "description": "This is a model with ordered properties", "type": "object", "properties": { "zebra": { "type": "string" }, "apple": { "type": "string" }, "hawaii": { "type": "string" } } }, "ModelWithDuplicateImports": { "description": "This is a model with duplicated imports", "type": "object", "properties": { "propA": { "$ref": "#/definitions/ModelWithString" }, "propB": { "$ref": "#/definitions/ModelWithString" }, "propC": { "$ref": "#/definitions/ModelWithString" } } }, "ModelThatExtends": { "description": "This is a model that extends another model", "type": "object", "allOf": [ { "$ref": "#/definitions/ModelWithString" }, { "type": "object", "properties": { "propExtendsA": { "type": "string" }, "propExtendsB": { "$ref": "#/definitions/ModelWithString" } } } ] }, "ModelThatExtendsExtends": { "description": "This is a model that extends another model", "type": "object", "allOf": [ { "$ref": "#/definitions/ModelWithString" }, { "$ref": "#/definitions/ModelThatExtends" }, { "type": "object", "properties": { "propExtendsC": { "type": "string" }, "propExtendsD": { "$ref": "#/definitions/ModelWithString" } } } ] }, "ModelWithPattern": { "description": "This is a model that contains a some patterns", "type": "object", "required": [ "key", "name" ], "properties": { "key": { "maxLength": 64, "pattern": "^[a-zA-Z0-9_]*$", "type": "string" }, "name": { "maxLength": 255, "type": "string" }, "enabled": { "type": "boolean", "readOnly": true }, "modified": { "type": "string", "format": "date-time", "readOnly": true }, "id": { "type": "string", "pattern": "^\\d{2}-\\d{3}-\\d{4}$" }, "text": { "type": "string", "pattern": "^\\w+$" } } } } }