Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
15 changes: 15 additions & 0 deletions src/test-routes/parameter-grouping.ts
Original file line number Diff line number Diff line change
@@ -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,
};
});
});
37 changes: 36 additions & 1 deletion swagger/azure-parameter-grouping.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -228,4 +263,4 @@
}
}
}
}
}