@microsoft.azure/autorest.testserver
Version:
Autorest test server.
506 lines (505 loc) • 15 kB
JSON
{
"swagger": "2.0",
"info": {
"title": "AutoRest Swagger BAT Service",
"description": "Test Infrastructure for AutoRest Swagger BAT",
"version": "1.0.0"
},
"host": "localhost:3000",
"schemes": ["http"],
"produces": ["application/json"],
"consumes": ["application/json"],
"paths": {
"/string/null": {
"get": {
"operationId": "string_getNull",
"description": "Get null string value value",
"tags": ["String Operations"],
"responses": {
"200": {
"description": "The null String value",
"schema": {
"type": "string",
"enum": [null]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"operationId": "string_putNull",
"description": "Set string value null",
"parameters": [
{
"name": "stringBody",
"in": "body",
"schema": {
"type": "string"
}
}
],
"tags": ["String Operations"],
"responses": {
"200": {
"description": "Empty Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/string/empty": {
"get": {
"operationId": "string_getEmpty",
"description": "Get empty string value value ''",
"tags": ["String Operations"],
"responses": {
"200": {
"description": "The empty String value",
"schema": {
"type": "string",
"enum": [""],
"x-ms-enum": { "modelAsString": false }
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"operationId": "string_putEmpty",
"description": "Set string value empty ''",
"parameters": [
{
"name": "stringBody",
"in": "body",
"schema": {
"type": "string"
},
"required": true
}
],
"tags": ["String Operations"],
"responses": {
"200": {
"description": "Empty Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/string/mbcs": {
"get": {
"operationId": "string_getMbcs",
"description": "Get mbcs string value '啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€'",
"tags": ["String Operations"],
"responses": {
"200": {
"description": "The mbcs String value",
"schema": {
"type": "string",
"enum": [
"啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€"
],
"x-ms-enum": { "modelAsString": false }
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"operationId": "string_putMbcs",
"description": "Set string value mbcs '啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€'",
"parameters": [
{
"name": "stringBody",
"in": "body",
"schema": {
"type": "string"
},
"required": true
}
],
"tags": ["String Operations"],
"responses": {
"200": {
"description": "Empty Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/string/whitespace": {
"get": {
"operationId": "string_getWhitespace",
"description": "Get string value with leading and trailing whitespace '<tab><space><space>Now is the time for all good men to come to the aid of their country<tab><space><space>'",
"tags": ["String Operations"],
"responses": {
"200": {
"description": "The String value with leading and trailing whitespace '<tab><space><space>Now is the time for all good men to come to the aid of their country<tab><space><space>'",
"schema": {
"type": "string",
"enum": [" Now is the time for all good men to come to the aid of their country "],
"x-ms-enum": { "modelAsString": false }
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"operationId": "string_putWhitespace",
"description": "Set String value with leading and trailing whitespace '<tab><space><space>Now is the time for all good men to come to the aid of their country<tab><space><space>'",
"parameters": [
{
"name": "stringBody",
"in": "body",
"schema": {
"type": "string"
},
"required": true
}
],
"tags": ["String Operations"],
"responses": {
"200": {
"description": "Empty Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/string/enum/notExpandable": {
"get": {
"operationId": "enum_getNotExpandable",
"description": "Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'.",
"tags": ["String Operations"],
"responses": {
"200": {
"description": "The String value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'",
"schema": {
"x-ms-enum": { "name": "Colors", "modelAsString": false },
"type": "string",
"enum": ["red color", "green-color", "blue_color"]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"operationId": "enum_putNotExpandable",
"description": "Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'",
"parameters": [
{
"name": "stringBody",
"in": "body",
"schema": {
"x-ms-enum": { "name": "Colors", "modelAsString": false },
"type": "string",
"enum": ["red color", "green-color", "blue_color"]
},
"required": true
}
],
"tags": ["String Operations"],
"responses": {
"200": {
"description": "Empty Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/string/enum/Referenced": {
"get": {
"operationId": "enum_getReferenced",
"description": "Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'.",
"tags": ["String Operations"],
"responses": {
"200": {
"description": "The String value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'",
"schema": {
"$ref": "#/definitions/RefColors"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"operationId": "enum_putReferenced",
"description": "Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'",
"parameters": [
{
"name": "enumStringBody",
"in": "body",
"schema": {
"$ref": "#/definitions/RefColors"
},
"required": true
}
],
"tags": ["String Operations"],
"responses": {
"200": {
"description": "Empty Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/string/enum/ReferencedConstant": {
"get": {
"operationId": "enum_getReferencedConstant",
"description": "Get value 'green-color' from the constant.",
"tags": ["String Operations"],
"responses": {
"200": {
"description": "The String value 'green-color' from a constant",
"schema": {
"$ref": "#/definitions/RefColorConstant"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"operationId": "enum_putReferencedConstant",
"description": "Sends value 'green-color' from a constant",
"parameters": [
{
"name": "enumStringBody",
"in": "body",
"schema": {
"$ref": "#/definitions/RefColorConstant"
},
"required": true
}
],
"tags": ["String Operations"],
"responses": {
"200": {
"description": "Empty Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/string/notProvided": {
"get": {
"operationId": "string_getNotProvided",
"description": "Get String value when no string value is sent in response payload",
"tags": ["String Operations"],
"responses": {
"200": {
"description": "The not provided string value",
"schema": {
"type": "string"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/string/base64Encoding": {
"get": {
"operationId": "string_getBase64Encoded",
"description": "Get value that is base64 encoded",
"tags": ["String Operations"],
"responses": {
"200": {
"description": "The base64 encoded string value",
"schema": {
"type": "string",
"format": "base64url"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/string/base64UrlEncoding": {
"get": {
"operationId": "string_getBase64UrlEncoded",
"description": "Get value that is base64url encoded",
"tags": ["String Operations"],
"responses": {
"200": {
"description": "The base64url encoded string value",
"schema": {
"type": "string",
"format": "base64url"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"operationId": "string_putBase64UrlEncoded",
"description": "Put value that is base64url encoded",
"parameters": [
{
"name": "stringBody",
"in": "body",
"schema": {
"type": "string",
"format": "base64url"
},
"required": true
}
],
"tags": ["String Operations"],
"responses": {
"200": {
"description": "Empty Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/string/nullBase64UrlEncoding": {
"get": {
"operationId": "string_getNullBase64UrlEncoded",
"description": "Get null value that is expected to be base64url encoded",
"tags": ["String Operations"],
"responses": {
"200": {
"description": "The null value",
"schema": {
"type": "string",
"format": "base64url"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"definitions": {
"Error": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
},
"RefColors": {
"x-ms-enum": { "name": "Colors", "modelAsString": false },
"type": "string",
"enum": ["red color", "green-color", "blue_color"],
"description": "Referenced Color Enum Description."
},
"RefColorConstant": {
"type": "object",
"properties": {
"ColorConstant": {
"x-ms-enum": { "name": "ColorConstant", "modelAsString": false },
"type": "string",
"enum": ["green-color"],
"description": "Referenced Color Constant Description."
},
"field1": {
"type": "string",
"description": "Sample string."
}
},
"required": ["ColorConstant"]
}
}
}