From 64d958d9919c2dfea30ea57141dd2bfe208be6e8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 22 Dec 2025 08:15:44 +0000 Subject: [PATCH 1/3] Initial plan From 2ed2848dcf51fc34789000692fb4158d8b8c1f69 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 22 Dec 2025 08:20:18 +0000 Subject: [PATCH 2/3] Add test case for model property named "list" Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> --- ...-list-property-test-2025-12-22-08-19-30.md | 7 +++++++ .../http-specs/specs/special-words/main.tsp | 19 +++++++++++++++++++ .../http-specs/specs/special-words/mockapi.ts | 14 ++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 .chronus/changes/add-list-property-test-2025-12-22-08-19-30.md diff --git a/.chronus/changes/add-list-property-test-2025-12-22-08-19-30.md b/.chronus/changes/add-list-property-test-2025-12-22-08-19-30.md new file mode 100644 index 00000000000..d5e233b0585 --- /dev/null +++ b/.chronus/changes/add-list-property-test-2025-12-22-08-19-30.md @@ -0,0 +1,7 @@ +--- +changeKind: internal +packages: + - "@typespec/http-specs" +--- + +Add test case for model property named "list" to cover special word scenarios diff --git a/packages/http-specs/specs/special-words/main.tsp b/packages/http-specs/specs/special-words/main.tsp index 2705d858905..a48f1a3f257 100644 --- a/packages/http-specs/specs/special-words/main.tsp +++ b/packages/http-specs/specs/special-words/main.tsp @@ -34,6 +34,7 @@ using Spector; * in * is * lambda + * list * not * or * pass @@ -269,4 +270,22 @@ namespace ModelProperties { """) @route("dict-methods") op dictMethods(@body body: DictMethods): void; + + // Test for model property named "list" which is a reserved word in many languages + model ModelWithList { + list: string; + } + + @scenario + @scenarioDoc(""" + Verify that a property can be named "list", which is a reserved word in many languages like Python. + + Send + + ```json + {"list": "ok"} + ``` + """) + @route("list") + op withList(@body body: ModelWithList): void; } diff --git a/packages/http-specs/specs/special-words/mockapi.ts b/packages/http-specs/specs/special-words/mockapi.ts index 4d2883b10f1..7700397ade7 100644 --- a/packages/http-specs/specs/special-words/mockapi.ts +++ b/packages/http-specs/specs/special-words/mockapi.ts @@ -39,6 +39,20 @@ Scenarios.SpecialWords_ModelProperties_dictMethods = passOnSuccess({ kind: "MockApiDefinition", }); +Scenarios.SpecialWords_ModelProperties_list = passOnSuccess({ + uri: "/special-words/model-properties/list", + method: "post", + request: { + body: json({ + list: "ok", + }), + }, + response: { + status: 204, + }, + kind: "MockApiDefinition", +}); + function createModelsTests(uri: string) { return passOnSuccess({ uri, From d7d37a8fa146710399b0fc9e055858879debb6cd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 22 Dec 2025 08:32:51 +0000 Subject: [PATCH 3/3] Fix mock API scenario name and regenerate summary Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> --- packages/http-specs/spec-summary.md | 12 ++++++++++++ packages/http-specs/specs/special-words/mockapi.ts | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/http-specs/spec-summary.md b/packages/http-specs/spec-summary.md index cb3674d16d9..f2c7273d7d4 100644 --- a/packages/http-specs/spec-summary.md +++ b/packages/http-specs/spec-summary.md @@ -3517,6 +3517,18 @@ Send { "SameAsModel": "ok" } ``` +### SpecialWords_ModelProperties_withList + +- Endpoint: `get /special-words/model-properties/list` + +Verify that a property can be named "list", which is a reserved word in many languages like Python. + +Send + +```json +{ "list": "ok" } +``` + ### SpecialWords_Models_and - Endpoint: `get /special-words/models/and` diff --git a/packages/http-specs/specs/special-words/mockapi.ts b/packages/http-specs/specs/special-words/mockapi.ts index 7700397ade7..8076c8b7d4c 100644 --- a/packages/http-specs/specs/special-words/mockapi.ts +++ b/packages/http-specs/specs/special-words/mockapi.ts @@ -39,7 +39,7 @@ Scenarios.SpecialWords_ModelProperties_dictMethods = passOnSuccess({ kind: "MockApiDefinition", }); -Scenarios.SpecialWords_ModelProperties_list = passOnSuccess({ +Scenarios.SpecialWords_ModelProperties_withList = passOnSuccess({ uri: "/special-words/model-properties/list", method: "post", request: {