UNPKG

@microsoft.azure/autorest.testserver

Version:
1,574 lines 56.2 kB
{ "swagger": "2.0", "info": { "title": "AutoRest Complex Test Service", "description": "Test Infrastructure for AutoRest", "version": "2016-02-29" }, "host": "localhost:3000", "schemes": ["http"], "produces": ["application/json"], "consumes": ["application/json"], "paths": { "/complex/basic/valid": { "get": { "operationId": "basic_getValid", "description": "Get complex type {id: 2, name: 'abc', color: 'YELLOW'}", "responses": { "200": { "description": "Get complex type {id: 2, name: 'abc', color: 'YELLOW'}", "schema": { "$ref": "#/definitions/basic" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } }, "put": { "operationId": "basic_putValid", "description": "Please put {id: 2, name: 'abc', color: 'Magenta'}", "x-ms-examples": { "basic_putValid": { "$ref": "./examples/basic_putValid.json" } }, "parameters": [ { "name": "complexBody", "in": "body", "description": "Please put {id: 2, name: 'abc', color: 'Magenta'}", "schema": { "$ref": "#/definitions/basic" }, "required": true }, { "$ref": "#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "Empty Response" }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/basic/invalid": { "get": { "operationId": "basic_getInvalid", "description": "Get a basic complex type that is invalid for the local strong type", "responses": { "200": { "description": "Get complex types with basic property", "schema": { "$ref": "#/definitions/basic" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/basic/empty": { "get": { "operationId": "basic_getEmpty", "description": "Get a basic complex type that is empty", "responses": { "200": { "description": "Get complex types with basic property", "schema": { "$ref": "#/definitions/basic" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/basic/null": { "get": { "operationId": "basic_getNull", "description": "Get a basic complex type whose properties are null", "responses": { "200": { "description": "Get complex types with basic property", "schema": { "$ref": "#/definitions/basic" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/basic/notprovided": { "get": { "operationId": "basic_getNotProvided", "description": "Get a basic complex type while the server doesn't provide a response payload", "responses": { "200": { "description": "Get complex types with basic property", "schema": { "$ref": "#/definitions/basic" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/primitive/integer": { "get": { "operationId": "primitive_getInt", "description": "Get complex types with integer properties", "responses": { "200": { "description": "Get complex types with primitive property", "schema": { "$ref": "#/definitions/int-wrapper" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } }, "put": { "operationId": "primitive_putInt", "description": "Put complex types with integer properties", "x-ms-examples": { "primitive_putInt": { "$ref": "./examples/primitive_putInt.json" } }, "parameters": [ { "name": "complexBody", "in": "body", "description": "Please put -1 and 2", "schema": { "$ref": "#/definitions/int-wrapper" }, "required": true } ], "responses": { "200": { "description": "Empty Response" }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/primitive/long": { "get": { "operationId": "primitive_getLong", "description": "Get complex types with long properties", "responses": { "200": { "description": "Get complex types with primitive property", "schema": { "$ref": "#/definitions/long-wrapper" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } }, "put": { "operationId": "primitive_putLong", "description": "Put complex types with long properties", "x-ms-examples": { "primitive_putLong": { "$ref": "./examples/primitive_putLong.json" } }, "parameters": [ { "name": "complexBody", "in": "body", "description": "Please put 1099511627775 and -999511627788", "schema": { "$ref": "#/definitions/long-wrapper" }, "required": true } ], "responses": { "200": { "description": "Empty Response" }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/primitive/float": { "get": { "operationId": "primitive_getFloat", "description": "Get complex types with float properties", "responses": { "200": { "description": "Get complex types with primitive property", "schema": { "$ref": "#/definitions/float-wrapper" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } }, "put": { "operationId": "primitive_putFloat", "description": "Put complex types with float properties", "x-ms-examples": { "primitive_putFloat": { "$ref": "./examples/primitive_putFloat.json" } }, "parameters": [ { "name": "complexBody", "in": "body", "description": "Please put 1.05 and -0.003", "schema": { "$ref": "#/definitions/float-wrapper" }, "required": true } ], "responses": { "200": { "description": "Empty Response" }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/primitive/double": { "get": { "operationId": "primitive_getDouble", "description": "Get complex types with double properties", "responses": { "200": { "description": "Get complex types with primitive property", "schema": { "$ref": "#/definitions/double-wrapper" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } }, "put": { "operationId": "primitive_putDouble", "description": "Put complex types with double properties", "x-ms-examples": { "primitive_putDouble": { "$ref": "./examples/primitive_putDouble.json" } }, "parameters": [ { "name": "complexBody", "in": "body", "description": "Please put 3e-100 and -0.000000000000000000000000000000000000000000000000000000005", "schema": { "$ref": "#/definitions/double-wrapper" }, "required": true } ], "responses": { "200": { "description": "Empty Response" }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/primitive/bool": { "get": { "operationId": "primitive_getBool", "description": "Get complex types with bool properties", "responses": { "200": { "description": "Get complex types with primitive property", "schema": { "$ref": "#/definitions/boolean-wrapper" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } }, "put": { "operationId": "primitive_putBool", "description": "Put complex types with bool properties", "x-ms-examples": { "primitive_putBool": { "$ref": "./examples/primitive_putBool.json" } }, "parameters": [ { "name": "complexBody", "in": "body", "description": "Please put true and false", "schema": { "$ref": "#/definitions/boolean-wrapper" }, "required": true } ], "responses": { "200": { "description": "Empty Response" }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/primitive/string": { "get": { "operationId": "primitive_getString", "description": "Get complex types with string properties", "responses": { "200": { "description": "Get complex types with primitive property", "schema": { "$ref": "#/definitions/string-wrapper" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } }, "put": { "operationId": "primitive_putString", "description": "Put complex types with string properties", "x-ms-examples": { "primitive_putString": { "$ref": "./examples/primitive_putString.json" } }, "parameters": [ { "name": "complexBody", "in": "body", "description": "Please put 'goodrequest', '', and null", "schema": { "$ref": "#/definitions/string-wrapper" }, "required": true } ], "responses": { "200": { "description": "Empty Response" }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/primitive/date": { "get": { "operationId": "primitive_getDate", "description": "Get complex types with date properties", "responses": { "200": { "description": "Get complex types with primitive property", "schema": { "$ref": "#/definitions/date-wrapper" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } }, "put": { "operationId": "primitive_putDate", "description": "Put complex types with date properties", "x-ms-examples": { "primitive_putDate": { "$ref": "./examples/primitive_putDate.json" } }, "parameters": [ { "name": "complexBody", "in": "body", "description": "Please put '0001-01-01' and '2016-02-29'", "schema": { "$ref": "#/definitions/date-wrapper" }, "required": true } ], "responses": { "200": { "description": "Empty Response" }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/primitive/datetime": { "get": { "operationId": "primitive_getDateTime", "description": "Get complex types with datetime properties", "responses": { "200": { "description": "Get complex types with primitive property", "schema": { "$ref": "#/definitions/datetime-wrapper" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } }, "put": { "operationId": "primitive_putDateTime", "description": "Put complex types with datetime properties", "x-ms-examples": { "primitive_putDateTime": { "$ref": "./examples/primitive_putDateTime.json" } }, "parameters": [ { "name": "complexBody", "in": "body", "description": "Please put '0001-01-01T12:00:00-04:00' and '2015-05-18T11:38:00-08:00'", "schema": { "$ref": "#/definitions/datetime-wrapper" }, "required": true } ], "responses": { "200": { "description": "Empty Response" }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/primitive/datetimerfc1123": { "get": { "operationId": "primitive_getDateTimeRfc1123", "description": "Get complex types with datetimeRfc1123 properties", "responses": { "200": { "description": "Get complex types with primitive property", "schema": { "$ref": "#/definitions/datetimerfc1123-wrapper" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } }, "put": { "operationId": "primitive_putDateTimeRfc1123", "description": "Put complex types with datetimeRfc1123 properties", "x-ms-examples": { "primitive_putDateTimeRfc1123": { "$ref": "./examples/primitive_putDateTimeRfc1123.json" } }, "parameters": [ { "name": "complexBody", "in": "body", "description": "Please put 'Mon, 01 Jan 0001 12:00:00 GMT' and 'Mon, 18 May 2015 11:38:00 GMT'", "schema": { "$ref": "#/definitions/datetimerfc1123-wrapper" }, "required": true } ], "responses": { "200": { "description": "Empty Response" }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/primitive/duration": { "get": { "operationId": "primitive_getDuration", "description": "Get complex types with duration properties", "responses": { "200": { "description": "Get complex types with primitive property", "schema": { "$ref": "#/definitions/duration-wrapper" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } }, "put": { "operationId": "primitive_putDuration", "description": "Put complex types with duration properties", "x-ms-examples": { "primitive_putDuration": { "$ref": "./examples/primitive_putDuration.json" } }, "parameters": [ { "name": "complexBody", "in": "body", "description": "Please put 'P123DT22H14M12.011S'", "schema": { "$ref": "#/definitions/duration-wrapper" }, "required": true } ], "responses": { "200": { "description": "Empty Response" }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/primitive/byte": { "get": { "operationId": "primitive_getByte", "description": "Get complex types with byte properties", "responses": { "200": { "description": "Get complex types with primitive property", "schema": { "$ref": "#/definitions/byte-wrapper" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } }, "put": { "operationId": "primitive_putByte", "description": "Put complex types with byte properties", "x-ms-examples": { "primitive_putByte": { "$ref": "./examples/primitive_putByte.json" } }, "parameters": [ { "name": "complexBody", "in": "body", "description": "Please put non-ascii byte string hex(FF FE FD FC 00 FA F9 F8 F7 F6)", "schema": { "$ref": "#/definitions/byte-wrapper" }, "required": true } ], "responses": { "200": { "description": "Empty Response" }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/array/valid": { "get": { "operationId": "array_getValid", "description": "Get complex types with array property", "responses": { "200": { "description": "Complex object with array property", "schema": { "$ref": "#/definitions/array-wrapper" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } }, "put": { "operationId": "array_putValid", "description": "Put complex types with array property", "x-ms-examples": { "array_putValid": { "$ref": "./examples/array_putValid.json" } }, "parameters": [ { "name": "complexBody", "in": "body", "description": "Please put an array with 4 items: \"1, 2, 3, 4\", \"\", null, \"&S#$(*Y\", \"The quick brown fox jumps over the lazy dog\"", "schema": { "$ref": "#/definitions/array-wrapper" }, "required": true } ], "responses": { "200": { "description": "Empty Response" }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/array/empty": { "get": { "operationId": "array_getEmpty", "description": "Get complex types with array property which is empty", "responses": { "200": { "description": "Complex object with array property", "schema": { "$ref": "#/definitions/array-wrapper" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } }, "put": { "operationId": "array_putEmpty", "description": "Put complex types with array property which is empty", "x-ms-examples": { "array_putEmpty": { "$ref": "./examples/array_putEmpty.json" } }, "parameters": [ { "name": "complexBody", "in": "body", "description": "Please put an empty array", "schema": { "$ref": "#/definitions/array-wrapper" }, "required": true } ], "responses": { "200": { "description": "Empty Response" }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/array/notprovided": { "get": { "operationId": "array_getNotProvided", "description": "Get complex types with array property while server doesn't provide a response payload", "responses": { "200": { "description": "Complex object with array property", "schema": { "$ref": "#/definitions/array-wrapper" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/dictionary/typed/valid": { "get": { "operationId": "dictionary_getValid", "description": "Get complex types with dictionary property", "responses": { "200": { "description": "Complex object with dictionary property", "schema": { "$ref": "#/definitions/dictionary-wrapper" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } }, "put": { "operationId": "dictionary_putValid", "description": "Put complex types with dictionary property", "x-ms-examples": { "dictionary_putValid": { "$ref": "./examples/dictionary_putValid.json" } }, "parameters": [ { "name": "complexBody", "in": "body", "description": "Please put a dictionary with 5 key-value pairs: \"txt\":\"notepad\", \"bmp\":\"mspaint\", \"xls\":\"excel\", \"exe\":\"\", \"\":null", "schema": { "$ref": "#/definitions/dictionary-wrapper" }, "required": true } ], "responses": { "200": { "description": "Empty Response" }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/dictionary/typed/empty": { "get": { "operationId": "dictionary_getEmpty", "description": "Get complex types with dictionary property which is empty", "responses": { "200": { "description": "Complex object with dictionary property", "schema": { "$ref": "#/definitions/dictionary-wrapper" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } }, "put": { "operationId": "dictionary_putEmpty", "description": "Put complex types with dictionary property which is empty", "x-ms-examples": { "dictionary_putEmpty": { "$ref": "./examples/dictionary_putEmpty.json" } }, "parameters": [ { "name": "complexBody", "in": "body", "description": "Please put an empty dictionary", "schema": { "$ref": "#/definitions/dictionary-wrapper" }, "required": true } ], "responses": { "200": { "description": "Empty Response" }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/dictionary/typed/null": { "get": { "operationId": "dictionary_getNull", "description": "Get complex types with dictionary property which is null", "responses": { "200": { "description": "Complex object with dictionary property", "schema": { "$ref": "#/definitions/dictionary-wrapper" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/dictionary/typed/notprovided": { "get": { "operationId": "dictionary_getNotProvided", "description": "Get complex types with dictionary property while server doesn't provide a response payload", "responses": { "200": { "description": "Complex object with dictionary property", "schema": { "$ref": "#/definitions/dictionary-wrapper" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/inheritance/valid": { "get": { "operationId": "inheritance_getValid", "description": "Get complex types that extend others", "responses": { "200": { "description": "Complex object that extends cat and pet", "schema": { "$ref": "#/definitions/siamese" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } }, "put": { "operationId": "inheritance_putValid", "description": "Put complex types that extend others", "x-ms-examples": { "inheritance_putValid": { "$ref": "./examples/inheritance_putValid.json" } }, "parameters": [ { "name": "complexBody", "in": "body", "description": "Please put a siamese with id=2, name=\"Siameee\", color=green, breed=persion, which hates 2 dogs, the 1st one named \"Potato\" with id=1 and food=\"tomato\", and the 2nd one named \"Tomato\" with id=-1 and food=\"french fries\".", "schema": { "$ref": "#/definitions/siamese" }, "required": true } ], "responses": { "200": { "description": "Empty Response" }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/polymorphism/valid": { "get": { "operationId": "polymorphism_getValid", "description": "Get complex types that are polymorphic", "responses": { "200": { "description": "Returns an object like this: {\n 'fishtype':'Salmon',\n 'location':'alaska',\n 'iswild':true,\n 'species':'king',\n 'length':1.0,\n 'siblings':[\n {\n 'fishtype':'Shark',\n 'age':6,\n 'birthday': '2012-01-05T01:00:00Z',\n 'length':20.0,\n 'species':'predator',\n },\n {\n 'fishtype':'Sawshark',\n 'age':105,\n 'birthday': '1900-01-05T01:00:00Z',\n 'length':10.0,\n 'picture': new Buffer([255, 255, 255, 255, 254]).toString('base64'),\n 'species':'dangerous',\n },\n {\n 'fishtype': 'goblin',\n 'age': 1,\n 'birthday': '2015-08-08T00:00:00Z',\n 'length': 30.0,\n 'species': 'scary',\n 'jawsize': 5\n }\n ]\n };", "schema": { "$ref": "#/definitions/Fish" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } }, "put": { "operationId": "polymorphism_putValid", "description": "Put complex types that are polymorphic", "x-ms-examples": { "polymorphism_putValid": { "$ref": "./examples/polymorphism_putValid.json" } }, "parameters": [ { "name": "complexBody", "in": "body", "description": "Please put a salmon that looks like this:\n{\n 'fishtype':'Salmon',\n 'location':'alaska',\n 'iswild':true,\n 'species':'king',\n 'length':1.0,\n 'siblings':[\n {\n 'fishtype':'Shark',\n 'age':6,\n 'birthday': '2012-01-05T01:00:00Z',\n 'length':20.0,\n 'species':'predator',\n },\n {\n 'fishtype':'Sawshark',\n 'age':105,\n 'birthday': '1900-01-05T01:00:00Z',\n 'length':10.0,\n 'picture': new Buffer([255, 255, 255, 255, 254]).toString('base64'),\n 'species':'dangerous',\n },\n {\n 'fishtype': 'goblin',\n 'age': 1,\n 'birthday': '2015-08-08T00:00:00Z',\n 'length': 30.0,\n 'species': 'scary',\n 'jawsize': 5\n }\n ]\n };", "schema": { "$ref": "#/definitions/Fish" }, "required": true } ], "responses": { "200": { "description": "Empty Response" }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/polymorphism/dotsyntax": { "get": { "operationId": "polymorphism_getDotSyntax", "description": "Get complex types that are polymorphic, JSON key contains a dot", "responses": { "200": { "description": "Returns an object like where JSON key of discriminator contains a dot", "schema": { "$ref": "#/definitions/DotFish" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/polymorphism/composedWithDiscriminator": { "get": { "operationId": "polymorphism_getComposedWithDiscriminator", "description": "Get complex object composing a polymorphic scalar property and array property with polymorphic element type, with discriminator specified. Deserialization must NOT fail and use the discriminator type specified on the wire.", "responses": { "200": { "description": "Returns an object that composes a scalar polymorphic object and array of polymorphic objects with discriminator specified", "schema": { "$ref": "#/definitions/DotFishMarket" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/polymorphism/composedWithoutDiscriminator": { "get": { "operationId": "polymorphism_getComposedWithoutDiscriminator", "description": "Get complex object composing a polymorphic scalar property and array property with polymorphic element type, without discriminator specified on wire. Deserialization must NOT fail and use the explicit type of the property.", "responses": { "200": { "description": "Returns an object that composes a scalar polymorphic object and array of polymorphic objects without discriminator specified", "schema": { "$ref": "#/definitions/DotFishMarket" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/polymorphism/complicated": { "get": { "operationId": "polymorphism_getComplicated", "description": "Get complex types that are polymorphic, but not at the root of the hierarchy; also have additional properties", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/salmon" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } }, "put": { "operationId": "polymorphism_putComplicated", "description": "Put complex types that are polymorphic, but not at the root of the hierarchy; also have additional properties", "x-ms-examples": { "polymorphism_putComplicated": { "$ref": "./examples/polymorphism_putComplicated.json" } }, "parameters": [ { "name": "complexBody", "in": "body", "schema": { "$ref": "#/definitions/salmon" }, "required": true } ], "responses": { "200": { "description": "Empty Response" }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/polymorphism/missingdiscriminator": { "put": { "operationId": "polymorphism_putMissingDiscriminator", "description": "Put complex types that are polymorphic, omitting the discriminator", "x-ms-examples": { "polymorphism_putMissingDiscriminator": { "$ref": "./examples/polymorphism_putMissingDiscriminator.json" } }, "parameters": [ { "name": "complexBody", "in": "body", "schema": { "$ref": "#/definitions/salmon" }, "required": true } ], "responses": { "200": { "description": "Returns a salmon", "schema": { "$ref": "#/definitions/salmon" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/polymorphism/missingrequired/invalid": { "put": { "operationId": "polymorphism_putValidMissingRequired", "description": "Put complex types that are polymorphic, attempting to omit required 'birthday' field - the request should not be allowed from the client", "parameters": [ { "name": "complexBody", "in": "body", "description": "Please attempt put a sawshark that looks like this, the client should not allow this data to be sent:\n{\n \"fishtype\": \"sawshark\",\n \"species\": \"snaggle toothed\",\n \"length\": 18.5,\n \"age\": 2,\n \"birthday\": \"2013-06-01T01:00:00Z\",\n \"location\": \"alaska\",\n \"picture\": base64(FF FF FF FF FE),\n \"siblings\": [\n {\n \"fishtype\": \"shark\",\n \"species\": \"predator\",\n \"birthday\": \"2012-01-05T01:00:00Z\",\n \"length\": 20,\n \"age\": 6\n },\n {\n \"fishtype\": \"sawshark\",\n \"species\": \"dangerous\",\n \"picture\": base64(FF FF FF FF FE),\n \"length\": 10,\n \"age\": 105\n }\n ]\n}", "schema": { "$ref": "#/definitions/Fish" }, "required": true } ], "responses": { "200": { "description": "Empty Response" }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/polymorphicrecursive/valid": { "get": { "operationId": "polymorphicrecursive_getValid", "description": "Get complex types that are polymorphic and have recursive references", "responses": { "200": { "description": "Complex object that extends cat and pet, returns a Salmon like this:\n{\n 'fishtype':'Salmon',\n 'location':'alaska',\n 'iswild':true,\n 'species':'king',\n 'length':1,\n 'siblings':[\n {\n 'fishtype':'Shark',\n 'age':6,\n 'birthday': '2012-01-05T01:00:00Z',\n 'species':'predator',\n 'length':20,\n 'siblings':[\n {\n 'fishtype':'Salmon',\n 'location':'atlantic',\n 'iswild':true,\n 'species':'coho',\n 'length':2,\n 'siblings':[\n {\n 'fishtype':'Shark',\n 'age':6,\n 'birthday': '2012-01-05T01:00:00Z',\n 'species':'predator',\n 'length':20\n },\n {\n 'fishtype':'Sawshark',\n 'age':105,\n 'birthday': '1900-01-05T01:00:00Z',\n 'picture': new Buffer([255, 255, 255, 255, 254]).toString('base64'),\n 'species':'dangerous',\n 'length':10\n }\n ]\n },\n {\n 'fishtype':'Sawshark',\n 'age':105,\n 'birthday': '1900-01-05T01:00:00Z',\n 'picture': new Buffer([255, 255, 255, 255, 254]).toString('base64'),\n 'species':'dangerous',\n 'length':10,\n 'siblings':[]\n }\n ]\n },\n {\n 'fishtype':'Sawshark',\n 'age':105,\n 'birthday': '1900-01-05T01:00:00Z',\n 'picture': new Buffer([255, 255, 255, 255, 254]).toString('base64'),\n 'species':'dangerous',\n 'length':10,'siblings':[]\n }\n ]\n };", "schema": { "$ref": "#/definitions/Fish" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } }, "put": { "operationId": "polymorphicrecursive_putValid", "description": "Put complex types that are polymorphic and have recursive references", "parameters": [ { "name": "complexBody", "in": "body", "description": "Please put a salmon that looks like this:\n{\n \"fishtype\": \"salmon\",\n \"species\": \"king\",\n \"length\": 1,\n \"age\": 1,\n \"location\": \"alaska\",\n \"iswild\": true,\n \"siblings\": [\n {\n \"fishtype\": \"shark\",\n \"species\": \"predator\",\n \"length\": 20,\n \"age\": 6,\n \"siblings\": [\n {\n \"fishtype\": \"salmon\",\n \"species\": \"coho\",\n \"length\": 2,\n \"age\": 2,\n \"location\": \"atlantic\",\n \"iswild\": true,\n \"siblings\": [\n {\n \"fishtype\": \"shark\",\n \"species\": \"predator\",\n \"length\": 20,\n \"age\": 6\n },\n {\n \"fishtype\": \"sawshark\",\n \"species\": \"dangerous\",\n \"length\": 10,\n \"age\": 105\n }\n ]\n },\n {\n \"fishtype\": \"sawshark\",\n \"species\": \"dangerous\",\n \"length\": 10,\n \"age\": 105\n }\n ]\n },\n {\n \"fishtype\": \"sawshark\",\n \"species\": \"dangerous\",\n \"length\": 10,\n \"age\": 105\n }\n ]\n}", "schema": { "$ref": "#/definitions/Fish" }, "required": true } ], "responses": { "200": { "description": "Empty Response" }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/readonlyproperty/valid": { "get": { "operationId": "readonlyproperty_getValid", "description": "Get complex types that have readonly properties", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/readonly-obj" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } }, "put": { "operationId": "readonlyproperty_putValid", "description": "Put complex types that have readonly properties", "x-ms-examples": { "readonlyproperty_putValid": { "$ref": "./examples/readonlyproperty_putValid.json" } }, "parameters": [ { "name": "complexBody", "in": "body", "schema": { "$ref": "#/definitions/readonly-obj" }, "required": true } ], "responses": { "200": { "description": "Empty Response" }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/complex/flatten/valid": { "get": { "operationId": "flattencomplex_getValid", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/MyBaseType" } } } } } }, "definitions": { "Error": { "type": "object", "properties": { "status": { "type": "integer", "format": "int32" }, "message": { "type": "string" } } }, "basic": { "type": "object", "properties": { "id": { "type": "integer", "description": "Basic Id", "x-nullable": true }, "name": { "type": "string", "description": "Name property with a very long description that does not fit on a single line and a line break." }, "color": { "type": "string", "enum": ["cyan", "Magenta", "YELLOW", "blacK"], "x-ms-enum": { "name": "CMYKColors", "modelAsString": true } } } }, "pet": { "type": "object", "properties": { "id": { "type": "integer" }, "name": { "type": "string" } } }, "cat": { "allOf": [ { "$ref": "#/definitions/pet" } ], "type": "object", "properties": { "color": { "type": "string" }, "hates": { "type": "array", "items": { "$ref": "#/definitions/dog" } } } }, "siamese": { "allOf": [ { "$ref": "#/definitions/cat" } ], "type": "object", "properties": { "breed": { "type": "string" } } }, "dog": { "allOf": [ { "$ref": "#/definitions/pet" } ], "type": "object", "properties": { "food": { "type": "string" } } }, "DotFish": { "type": "object", "discriminator": "fish.type", "required": ["fish.type"], "properties": { "fish.type": { "type": "string" }, "species": { "type": "string" } } }, "DotSalmon": { "allOf": [ { "$ref": "#/definitions/DotFish" } ], "type": "object", "properties": { "location": { "type": "string" }, "iswild": { "type": "boolean" } } }, "DotFishMarket": { "properties": { "sampleSalmon": { "$ref": "#/definitions/DotSalmon" }, "salmons": { "type": "array", "items": { "$ref": "#/definitions/DotSalmon" } }, "sampleFish": { "$ref": "#/definitions/DotFish" }, "fishes": { "type": "array", "items": { "$ref": "#/definitions/DotFish" } } } }, "Fish": { "type": "object", "discriminator": "fishtype", "required": ["fishtype", "length"], "properties": { "fishtype": { "type": "string" }, "species": { "type": "string" }, "length": { "type": "number", "format": "float" }, "siblings": { "type": "array", "items": { "$ref": "#/definitions/Fish" } } } }, "salmon": { "allOf": [ { "$ref": "#/definitions/Fish" } ], "type": "object", "properties": { "location": { "type": "string" }, "iswild": { "type": "boolean" } } }, "smart_salmon": { "type": "object", "allOf": [ { "$ref": "#/definitions/salmon" } ], "properties": { "college_degree": { "type": "string" } }, "additionalProperties": true }, "shark": { "allOf": [ { "$ref": "#/definitions/Fish" } ], "type": "object", "required": ["birthday"], "properties": { "age": { "type": "integer", "format": "int32" }, "birthday": { "type": "string", "format": "date-time" } } }, "sawshark": { "allOf": [ { "$ref": "#/definitions/shark"