@microsoft.azure/autorest.testserver
Version:
Autorest test server.
308 lines (307 loc) • 8.48 kB
JSON
{
"swagger": "2.0",
"info": {
"title": "AutoRest Parameter Grouping Test Service",
"description": "Test Infrastructure for AutoRest",
"version": "1.0.0"
},
"host": "localhost:3000",
"schemes": ["http"],
"produces": ["application/json"],
"consumes": ["application/json"],
"paths": {
"/parameterGrouping/postRequired/{path}": {
"post": {
"operationId": "parameterGrouping_postRequired",
"description": "Post a bunch of required parameters grouped",
"parameters": [
{
"name": "body",
"in": "body",
"schema": {
"type": "integer",
"format": "int32"
},
"required": true,
"x-ms-parameter-grouping": {}
},
{
"name": "customHeader",
"in": "header",
"type": "string",
"required": false,
"x-ms-parameter-grouping": {}
},
{
"name": "query",
"in": "query",
"required": false,
"type": "integer",
"format": "int32",
"default": 30,
"description": "Query parameter with default",
"x-ms-parameter-grouping": {}
},
{
"name": "path",
"in": "path",
"required": true,
"type": "string",
"description": "Path parameter",
"x-ms-parameter-grouping": {}
}
],
"responses": {
"200": {
"description": "Success"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/parameterGrouping/postOptional": {
"post": {
"operationId": "parameterGrouping_postOptional",
"description": "Post a bunch of optional parameters grouped",
"parameters": [
{
"name": "customHeader",
"in": "header",
"type": "string",
"required": false,
"x-ms-parameter-grouping": {}
},
{
"name": "query",
"in": "query",
"required": false,
"type": "integer",
"format": "int32",
"default": 30,
"description": "Query parameter with default",
"x-ms-parameter-grouping": {}
}
],
"responses": {
"200": {
"description": "Success"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/parameterGrouping/postReservedWords": {
"post": {
"operationId": "parameterGrouping_postReservedWords",
"description": "Post a grouped parameters with reserved words",
"parameters": [
{
"name": "from",
"in": "query",
"description": "'from' is a reserved word. Pass in 'bob' to pass.",
"type": "string",
"x-ms-parameter-grouping": {}
},
{
"name": "accept",
"in": "query",
"description": "'accept' is a reserved word. Pass in 'yes' to pass.",
"type": "string",
"x-ms-parameter-grouping": {}
}
],
"responses": {
"200": {
"description": "Success"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/parameterGrouping/postMultipleParameterGroups": {
"post": {
"operationId": "parameterGrouping_postMultiParamGroups",
"description": "Post parameters from multiple different parameter groups",
"parameters": [
{
"name": "header-one",
"in": "header",
"type": "string",
"required": false,
"x-ms-parameter-grouping": {
"name": "first-parameter-group"
}
},
{
"name": "query-one",
"in": "query",
"required": false,
"type": "integer",
"format": "int32",
"default": 30,
"description": "Query parameter with default",
"x-ms-parameter-grouping": {
"name": "first-parameter-group"
}
},
{
"name": "header-two",
"in": "header",
"type": "string",
"required": false,
"x-ms-parameter-grouping": {
"postfix": "second-param-group"
}
},
{
"name": "query-two",
"in": "query",
"required": false,
"type": "integer",
"format": "int32",
"default": 30,
"description": "Query parameter with default",
"x-ms-parameter-grouping": {
"postfix": "second-param-group"
}
}
],
"responses": {
"200": {
"description": "Success"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/parameterGrouping/sharedParameterGroupObject": {
"post": {
"operationId": "parameterGrouping_postSharedParameterGroupObject",
"description": "Post parameters with a shared parameter group object",
"parameters": [
{
"name": "header-one",
"in": "header",
"type": "string",
"required": false,
"x-ms-parameter-grouping": {
"name": "first-parameter-group"
}
},
{
"name": "query-one",
"in": "query",
"required": false,
"type": "integer",
"format": "int32",
"default": 30,
"description": "Query parameter with default",
"x-ms-parameter-grouping": {
"name": "first-parameter-group"
}
}
],
"responses": {
"200": {
"description": "Success"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/parameterGrouping/groupWithConstant": {
"put": {
"operationId": "parameterGrouping_groupWithConstant",
"description": "Parameter group with a constant. Pass in 'foo' for groupedConstant and 'bar' for groupedParameter.",
"tags": ["File and Directory Operations"],
"parameters": [
{
"$ref": "#/parameters/GroupedConstant"
},
{
"$ref": "#/parameters/GroupedParameter"
}
],
"responses": {
"200": {
"description": "Success"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"definitions": {
"Error": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
},
"parameters": {
"GroupedConstant": {
"name": "groupedConstant",
"type": "string",
"in": "header",
"required": false,
"enum": ["foo"],
"x-ms-enum": {
"name": "EncryptionAlgorithmType",
"modelAsString": false
},
"x-ms-parameter-location": "method",
"x-ms-parameter-grouping": {
"name": "grouper"
},
"description": "A grouped parameter that is a constant."
},
"GroupedParameter": {
"name": "groupedParameter",
"type": "string",
"in": "header",
"required": false,
"x-ms-parameter-location": "method",
"x-ms-parameter-grouping": {
"name": "grouper"
},
"description": "Optional parameter part of a parameter grouping."
}
}
}