2020-11-19 14:37:23 +01:00

1889 lines
72 KiB
JSON

{
"openapi": "3.0.0",
"info": {
"title": "swagger",
"version": "v1.0"
},
"servers": [
{
"url": "http://localhost:3000/base"
}
],
"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",
"required": true,
"nullable": true,
"schema": {
"type": "string"
}
},
{
"description": "This is the parameter that goes into the query params",
"name": "parameterQuery",
"in": "query",
"required": true,
"nullable": true,
"schema": {
"type": "string"
}
},
{
"description": "This is the parameter that goes into the 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"
}
},
{
"description": "This is the parameter that goes into the path",
"name": "parameterPath",
"in": "path",
"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",
"required": true,
"nullable": true,
"content": {
"application/json": {
"description": "Message for default response",
"schema": {
"$ref": "#/components/schemas/ModelWithString"
}
}
}
}
}
},
"/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",
"required": false,
"nullable": false,
"schema": {
"type": "string"
}
},
{
"description": "This is the parameter that goes into the path",
"name": "parameter-path-2",
"in": "path",
"required": false,
"nullable": false,
"schema": {
"type": "string"
}
},
{
"description": "This is the parameter that goes into the path",
"name": "PARAMETER-PATH-3",
"in": "path",
"required": false,
"nullable": false,
"schema": {
"type": "string"
}
},
{
"description": "This is the parameter that goes into the request header",
"name": "parameter.header",
"in": "header",
"required": true,
"nullable": true,
"schema": {
"type": "string"
}
},
{
"description": "This is the parameter that goes into the request query params",
"name": "parameter-query",
"in": "query",
"required": true,
"nullable": true,
"schema": {
"type": "string"
}
},
{
"description": "This is the parameter that goes into the request form data",
"name": "parameter_form",
"in": "formData",
"required": true,
"nullable": true,
"schema": {
"type": "string"
}
},
{
"description": "This is the parameter that goes into the cookie",
"name": "PARAMETER-COOKIE",
"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",
"required": true,
"nullable": true,
"content": {
"application/json": {
"description": "Message for default response",
"schema": {
"$ref": "#/components/schemas/ModelWithString"
}
}
}
}
}
},
"/api/v{api-version}/parameters/": {
"get": {
"tags": [
"Parameters"
],
"operationId": "GetCallWithOptionalParam",
"parameters": [
{
"description": "This is an optional parameter",
"name": "parameter",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"description": "This is a required parameter",
"required": true,
"content": {
"application/json": {
"description": "Message for default response",
"schema": {
"$ref": "#/components/schemas/ModelWithString"
}
}
}
}
},
"post": {
"tags": [
"Parameters"
],
"operationId": "PostCallWithOptionalParam",
"parameters": [
{
"description": "This is a required parameter",
"name": "parameter",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"description": "This is an optional parameter",
"required": false,
"content": {
"application/json": {
"description": "Message for default response",
"schema": {
"$ref": "#/components/schemas/ModelWithString"
}
}
}
}
}
},
"/api/v{api-version}/requestBody/": {
"post": {
"tags": [
"RequestBody"
],
"requestBody": {
"$ref": "#/components/requestBodies/SimpleRequestBody"
}
}
},
"/api/v{api-version}/defaults": {
"get": {
"tags": [
"Defaults"
],
"operationId": "CallWithDefaultParameters",
"parameters": [
{
"description": "This is a simple string with default value",
"name": "parameterString",
"in": "query",
"nullable": true,
"schema": {
"type": "string",
"default": "Hello World!"
}
},
{
"description": "This is a simple number with default value",
"name": "parameterNumber",
"in": "query",
"nullable": true,
"schema": {
"type": "number",
"default": 123
}
},
{
"description": "This is a simple boolean with default value",
"name": "parameterBoolean",
"in": "query",
"nullable": true,
"schema": {
"type": "boolean",
"default": true
}
},
{
"description": "This is a simple enum with default value",
"name": "parameterEnum",
"in": "query",
"schema": {
"enum": [
"Success",
"Warning",
"Error"
],
"default": 0
}
},
{
"description": "This is a simple model with default value",
"name": "parameterModel",
"in": "query",
"nullable": true,
"schema": {
"$ref": "#/components/schemas/ModelWithString",
"default": {
"prop": "Hello World!"
}
}
}
]
},
"post": {
"tags": [
"Defaults"
],
"operationId": "CallWithDefaultOptionalParameters",
"parameters": [
{
"description": "This is a simple string that is optional with default value",
"name": "parameterString",
"in": "query",
"required": false,
"schema": {
"type": "string",
"default": "Hello World!"
}
},
{
"description": "This is a simple number that is optional with default value",
"name": "parameterNumber",
"in": "query",
"required": false,
"schema": {
"type": "number",
"default": 123
}
},
{
"description": "This is a simple boolean that is optional with default value",
"name": "parameterBoolean",
"in": "query",
"required": false,
"schema": {
"type": "boolean",
"default": true
}
},
{
"description": "This is a simple enum that is optional with default value",
"name": "parameterEnum",
"in": "query",
"required": false,
"schema": {
"enum": [
"Success",
"Warning",
"Error"
],
"default": 0
}
},
{
"description": "This is a simple model that is optional with default value",
"name": "parameterModel",
"in": "query",
"required": false,
"schema": {
"$ref": "#/components/schemas/ModelWithString",
"default": {
"prop": "Hello World!"
}
}
}
]
},
"put": {
"tags": [
"Defaults"
],
"operationId": "CallToTestOrderOfParams",
"parameters": [
{
"description": "This is a optional string with default",
"name": "parameterOptionalStringWithDefault",
"in": "query",
"required": false,
"schema": {
"type": "string",
"default": "Hello World!"
}
},
{
"description": "This is a optional string with empty default",
"name": "parameterOptionalStringWithEmptyDefault",
"in": "query",
"required": false,
"schema": {
"type": "string",
"default": ""
}
},
{
"description": "This is a optional string with no default",
"name": "parameterOptionalStringWithNoDefault",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "This is a string with default",
"name": "parameterStringWithDefault",
"in": "query",
"required": true,
"schema": {
"type": "string",
"default": "Hello World!"
}
},
{
"description": "This is a string with empty default",
"name": "parameterStringWithEmptyDefault",
"in": "query",
"required": true,
"schema": {
"type": "string",
"default": ""
}
},
{
"description": "This is a string with no default",
"name": "parameterStringWithNoDefault",
"in": "query",
"required": true,
"schema": {
"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": {
"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"
}
}
}
},
"200": {
"description": "Message for 200 response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"@namespace.string": {
"type": "string",
"readOnly": true
},
"@namespace.integer": {
"type": "integer",
"readOnly": true
},
"value": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ModelWithString"
},
"readOnly": true
}
}
}
}
}
},
"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}/upload": {
"post": {
"tags": [
"Upload"
],
"operationId": "UploadFile",
"parameters": [
{
"description": "Supply a file reference for upload",
"name": "file",
"in": "formData",
"required": true,
"schema": {
"type": "File"
}
},
{
"name": "api-version",
"in": "path",
"required": true,
"nullable": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"type": "boolean"
}
}
}
}
}
}
},
"/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"
}
}
}
},
"/api/v{api-version}/multipart": {
"get": {
"tags": [
"multipart"
],
"operationId": "MultipartResponse",
"responses": {
"200": {
"description": "OK",
"content": {
"multipart/mixed": {
"schema": {
"type": "object",
"properties": {
"file": {
"type": "string",
"format": "binary"
},
"metadata": {
"type": "object",
"properties": {
"foo": {
"type": "string"
},
"bar": {
"type": "string"
}
}
}
}
}
}
}
}
}
}
},
"/api/v{api-version}/complex/{id}": {
"put": {
"tags": [
"Complex"
],
"operationId": "ComplexParams",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"format": "int32"
}
},
{
"name": "api-version",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json-patch+json": {
"schema": {
"required": [
"key",
"name",
"parameters",
"type"
],
"type": "object",
"properties": {
"key": {
"maxLength": 64,
"pattern": "^[a-zA-Z0-9_]*$",
"type": "string",
"nullable": true,
"readOnly": true
},
"name": {
"maxLength": 255,
"type": "string",
"nullable": true
},
"enabled": {
"type": "boolean",
"default": true
},
"type": {
"enum": [
"Monkey",
"Horse",
"Bird"
],
"type": "string",
"readOnly": true
},
"listOfModels": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ModelWithString"
},
"nullable": true
},
"listOfStrings": {
"type": "array",
"items": {
"type": "string"
},
"nullable": true
},
"parameters": {
"type": "object",
"oneOf": [
{
"$ref": "#/components/schemas/ModelWithString"
},
{
"$ref": "#/components/schemas/ModelWithEnum"
},
{
"$ref": "#/components/schemas/ModelWithArray"
},
{
"$ref": "#/components/schemas/ModelWithDictionary"
}
]
},
"user": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int32",
"readOnly": true
},
"name": {
"type": "string",
"nullable": true,
"readOnly": true
}
},
"readOnly": true
}
}
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ModelWithString"
}
}
}
}
}
}
},
"/api/v{api-version}/header": {
"post": {
"tags": [
"Header"
],
"operationId": "CallWithResultFromHeader",
"responses": {
"200": {
"description": "Successful response",
"headers": {
"operation-location": {
"schema": {
"type": "string"
}
}
}
},
"400": {
"description": "400 server error"
},
"500": {
"description": "500 server error"
}
}
}
}
},
"components": {
"requestBodies": {
"SimpleRequestBody": {
"description": "A reusable request body",
"required": false,
"content": {
"application/json": {
"description": "Message for default response",
"schema": {
"$ref": "#/components/schemas/ModelWithString"
}
}
}
}
},
"schemas": {
"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": "#/components/schemas/ModelWithString"
},
"SimpleStringWithPattern": {
"description": "This is a simple string",
"type": "string",
"nullable": true,
"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": "#/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"
]
},
"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": "#/components/schemas/ModelWithProperties"
}
}
},
"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"
}
}
}
},
"ModelWithCircularReference": {
"description": "This is a model with one property containing a circular reference",
"type": "object",
"properties": {
"prop": {
"$ref": "#/components/schemas/ModelWithCircularReference"
}
}
},
"CompositionWithOneOf": {
"description": "This is a model with one property with a 'one of' relationship",
"type": "object",
"properties": {
"propA": {
"type": "object",
"oneOf": [
{
"$ref": "#/components/schemas/ModelWithString"
},
{
"$ref": "#/components/schemas/ModelWithEnum"
},
{
"$ref": "#/components/schemas/ModelWithArray"
},
{
"$ref": "#/components/schemas/ModelWithDictionary"
}
]
}
}
},
"CompositionWithOneOfAnonymous": {
"description": "This is a model with one property with a 'one of' relationship where the options are not $ref",
"type": "object",
"properties": {
"propA": {
"type": "object",
"oneOf": [
{
"description": "Anonymous object type",
"type": "object",
"properties": {
"propA": "string"
}
},
{
"description": "Anonymous string type",
"type": "string"
},
{
"description": "Anonymous integer type",
"type": "integer"
}
]
}
}
},
"CompositionWithAnyOf": {
"description": "This is a model with one property with a 'any of' relationship",
"type": "object",
"properties": {
"propA": {
"type": "object",
"anyOf": [
{
"$ref": "#/components/schemas/ModelWithString"
},
{
"$ref": "#/components/schemas/ModelWithEnum"
},
{
"$ref": "#/components/schemas/ModelWithArray"
},
{
"$ref": "#/components/schemas/ModelWithDictionary"
}
]
}
}
},
"CompositionWithAnyOfAnonymous": {
"description": "This is a model with one property with a 'any of' relationship where the options are not $ref",
"type": "object",
"properties": {
"propA": {
"type": "object",
"anyOf": [
{
"description": "Anonymous object type",
"type": "object",
"properties": {
"propA": "string"
}
},
{
"description": "Anonymous string type",
"type": "string"
},
{
"description": "Anonymous integer type",
"type": "integer"
}
]
}
}
},
"CompositionWithOneOfAndNullable": {
"description": "This is a model with one property with a 'one of' relationship",
"type": "object",
"properties": {
"propA": {
"nullable": true,
"type": "object",
"oneOf": [
{
"type": "object",
"properties": {
"boolean": {
"type": "boolean"
}
}
},
{
"$ref": "#/components/schemas/ModelWithEnum"
},
{
"$ref": "#/components/schemas/ModelWithArray"
},
{
"$ref": "#/components/schemas/ModelWithDictionary"
}
]
}
}
},
"CompositionWithAllOfAndNullable": {
"description": "This is a model with one property with a 'all of' relationship",
"type": "object",
"properties": {
"propA": {
"nullable": true,
"type": "object",
"allOf": [
{
"type": "object",
"properties": {
"boolean": {
"type": "boolean"
}
}
},
{
"$ref": "#/components/schemas/ModelWithEnum"
},
{
"$ref": "#/components/schemas/ModelWithArray"
},
{
"$ref": "#/components/schemas/ModelWithDictionary"
}
]
}
}
},
"CompositionWithAnyOfAndNullable": {
"description": "This is a model with one property with a 'any of' relationship",
"type": "object",
"properties": {
"propA": {
"nullable": true,
"type": "object",
"anyOf": [
{
"type": "object",
"properties": {
"boolean": {
"type": "boolean"
}
}
},
{
"$ref": "#/components/schemas/ModelWithEnum"
},
{
"$ref": "#/components/schemas/ModelWithArray"
},
{
"$ref": "#/components/schemas/ModelWithDictionary"
}
]
}
}
},
"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"
},
"@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,
"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"
}
}
},
"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": "#/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"
}
}
}
]
},
"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+$"
}
}
}
}
}
}