diff --git a/package.json b/package.json index c0e29551..6eda00af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@microsoft.azure/autorest.testserver", - "version": "3.0.26", + "version": "3.0.27", "description": "Autorest test server.", "main": "dist/cli/cli.js", "bin": { diff --git a/src/test-routes/parameter-grouping.ts b/src/test-routes/parameter-grouping.ts new file mode 100644 index 00000000..cf93b6e2 --- /dev/null +++ b/src/test-routes/parameter-grouping.ts @@ -0,0 +1,15 @@ +import { app, json, ValidationError } from "../api"; + +app.category("azure", () => { + app.post("/parameterGrouping/postReservedWords", "PostParameterGroupingWithReservedWords", (req) => { + if (req.query["from"] !== "bob") { + throw new ValidationError("Wrong query value for 'from'", "bob", req.query["from"]); + } + if (req.query["accept"] !== "yes") { + throw new ValidationError("Wrong query value for 'accept'", "yes", req.query["accept"]); + } + return { + status: 200, + }; + }); +}); diff --git a/swagger/azure-parameter-grouping.json b/swagger/azure-parameter-grouping.json index 33be7db1..b3f151f2 100644 --- a/swagger/azure-parameter-grouping.json +++ b/swagger/azure-parameter-grouping.json @@ -112,6 +112,41 @@ } } }, + "/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", @@ -228,4 +263,4 @@ } } } -} \ No newline at end of file +}