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/3] 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/3] 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/3] 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; };