From 4086aa3b5448e43c9a0ccf37900cfcb025914364 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Mar 2026 12:09:22 +0000 Subject: [PATCH 1/5] Initial plan From 12fc89eea7f29cffb57e9283756efb999c682757 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Mar 2026 12:23:46 +0000 Subject: [PATCH 2/5] fix: update response type of putExtensibleStringValue to include explicit content-type header Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> --- .../copilot-fix-response-type-case-2026-2-6-12-23-14.md | 7 +++++++ packages/http-specs/specs/special-words/main.tsp | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .chronus/changes/copilot-fix-response-type-case-2026-2-6-12-23-14.md diff --git a/.chronus/changes/copilot-fix-response-type-case-2026-2-6-12-23-14.md b/.chronus/changes/copilot-fix-response-type-case-2026-2-6-12-23-14.md new file mode 100644 index 00000000000..992172bd303 --- /dev/null +++ b/.chronus/changes/copilot-fix-response-type-case-2026-2-6-12-23-14.md @@ -0,0 +1,7 @@ +--- +changeKind: fix +packages: + - "@typespec/http-specs" +--- + +Fix response type of putExtensibleStringValue to include explicit content-type header \ No newline at end of file diff --git a/packages/http-specs/specs/special-words/main.tsp b/packages/http-specs/specs/special-words/main.tsp index e69f36b51b2..7b0e5d27b24 100644 --- a/packages/http-specs/specs/special-words/main.tsp +++ b/packages/http-specs/specs/special-words/main.tsp @@ -342,5 +342,8 @@ interface ExtensibleStrings { """) @put @route("/string") - putExtensibleStringValue(@body body: ExtensibleString): ExtensibleString; + putExtensibleStringValue(@body body: ExtensibleString): { + @header contentType: "application/json"; + @body body: ExtensibleString; + }; } From 4effaf410f77d1edc519c7a3d59c16d97f3a2c80 Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Mon, 9 Mar 2026 07:01:42 +0000 Subject: [PATCH 3/5] update --- .../http-specs/specs/special-words/main.tsp | 84 +++++++++---------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/packages/http-specs/specs/special-words/main.tsp b/packages/http-specs/specs/special-words/main.tsp index 7b0e5d27b24..cc269d1d8e5 100644 --- a/packages/http-specs/specs/special-words/main.tsp +++ b/packages/http-specs/specs/special-words/main.tsp @@ -290,51 +290,51 @@ namespace ModelProperties { op withList(@body body: ModelWithList): void; } -/** - * Verify enum member names that are special words using extensible enum (union). - */ -union ExtensibleString { - string, - and: "and", - as: "as", - assert: "assert", - async: "async", - await: "await", - break: "break", - class: "class", - constructor: "constructor", - continue: "continue", - def: "def", - del: "del", - elif: "elif", - `else`: "else", - except: "except", - exec: "exec", - finally: "finally", - for: "for", - from: "from", - global: "global", - `if`: "if", - `import`: "import", - in: "in", - `is`: "is", - lambda: "lambda", - not: "not", - or: "or", - pass: "pass", - raise: "raise", - `return`: "return", - try: "try", - while: "while", - with: "with", - yield: "yield", -} - /** * Verify enum member names that are special words. */ @route("/extensible-strings") -interface ExtensibleStrings { +namespace ExtensibleStrings { + /** + * Verify enum member names that are special words using extensible enum (union). + */ + union ExtensibleString { + string, + and: "and", + as: "as", + assert: "assert", + async: "async", + await: "await", + break: "break", + class: "class", + constructor: "constructor", + continue: "continue", + def: "def", + del: "del", + elif: "elif", + `else`: "else", + except: "except", + exec: "exec", + finally: "finally", + for: "for", + from: "from", + global: "global", + `if`: "if", + `import`: "import", + in: "in", + `is`: "is", + lambda: "lambda", + not: "not", + or: "or", + pass: "pass", + raise: "raise", + `return`: "return", + try: "try", + while: "while", + with: "with", + yield: "yield", + } + @scenario @scenarioDoc(""" Verify that enum members with special word names can be sent and received properly. @@ -342,7 +342,7 @@ interface ExtensibleStrings { """) @put @route("/string") - putExtensibleStringValue(@body body: ExtensibleString): { + op putExtensibleStringValue(@body body: ExtensibleString): { @header contentType: "application/json"; @body body: ExtensibleString; }; From f8d74067d4df42cdfb76990be1d36c55fe4e7d65 Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Wed, 11 Mar 2026 01:29:51 +0000 Subject: [PATCH 4/5] bump version --- .../copilot-fix-response-type-case-2026-2-6-12-23-14.md | 7 ------- packages/http-specs/CHANGELOG.md | 7 +++++++ packages/http-specs/package.json | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) delete mode 100644 .chronus/changes/copilot-fix-response-type-case-2026-2-6-12-23-14.md diff --git a/.chronus/changes/copilot-fix-response-type-case-2026-2-6-12-23-14.md b/.chronus/changes/copilot-fix-response-type-case-2026-2-6-12-23-14.md deleted file mode 100644 index 992172bd303..00000000000 --- a/.chronus/changes/copilot-fix-response-type-case-2026-2-6-12-23-14.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/http-specs" ---- - -Fix response type of putExtensibleStringValue to include explicit content-type header \ No newline at end of file diff --git a/packages/http-specs/CHANGELOG.md b/packages/http-specs/CHANGELOG.md index 1c1e4209686..cf9f9029c0a 100644 --- a/packages/http-specs/CHANGELOG.md +++ b/packages/http-specs/CHANGELOG.md @@ -1,5 +1,12 @@ # @typespec/http-specs +## 0.1.0-alpha.34 + +### Bug Fixes + +- [#9953](https://github.com/microsoft/typespec/pull/9953) Fix response type of putExtensibleStringValue to include explicit content-type header + + ## 0.1.0-alpha.33 ### Features diff --git a/packages/http-specs/package.json b/packages/http-specs/package.json index eb27534ed83..ad499f69b5c 100644 --- a/packages/http-specs/package.json +++ b/packages/http-specs/package.json @@ -1,7 +1,7 @@ { "name": "@typespec/http-specs", "displayName": "Http Specs", - "version": "0.1.0-alpha.33", + "version": "0.1.0-alpha.34", "description": "Spec scenarios and mock apis", "main": "dist/index.js", "type": "module", From b75cc493f6e84e9fff080028001d513025f77d76 Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Wed, 11 Mar 2026 14:39:13 +0800 Subject: [PATCH 5/5] fix: add content-type header to putExtensibleStringValue request Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- packages/http-specs/specs/special-words/main.tsp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/http-specs/specs/special-words/main.tsp b/packages/http-specs/specs/special-words/main.tsp index cc269d1d8e5..608b9b95f33 100644 --- a/packages/http-specs/specs/special-words/main.tsp +++ b/packages/http-specs/specs/special-words/main.tsp @@ -342,7 +342,10 @@ namespace ExtensibleStrings { """) @put @route("/string") - op putExtensibleStringValue(@body body: ExtensibleString): { + op putExtensibleStringValue( + @header contentType: "application/json", + @body body: ExtensibleString, + ): { @header contentType: "application/json"; @body body: ExtensibleString; };