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", diff --git a/packages/http-specs/specs/special-words/main.tsp b/packages/http-specs/specs/special-words/main.tsp index e69f36b51b2..608b9b95f33 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,5 +342,11 @@ interface ExtensibleStrings { """) @put @route("/string") - putExtensibleStringValue(@body body: ExtensibleString): ExtensibleString; + op putExtensibleStringValue( + @header contentType: "application/json", + @body body: ExtensibleString, + ): { + @header contentType: "application/json"; + @body body: ExtensibleString; + }; }