diff --git a/.chronus/changes/fix-payload-xml-content-type-2026-02-03-08-23-21.md b/.chronus/changes/fix-payload-xml-content-type-2026-02-03-08-23-21.md new file mode 100644 index 00000000000..ae27da44ecd --- /dev/null +++ b/.chronus/changes/fix-payload-xml-content-type-2026-02-03-08-23-21.md @@ -0,0 +1,7 @@ +--- +changeKind: fix +packages: + - "@typespec/http-specs" +--- + +Fix payload/xml XmlErrorValue response to wrap SimpleModel with content-type "application/xml" for consistency with XmlError diff --git a/packages/http-specs/specs/payload/xml/main.tsp b/packages/http-specs/specs/payload/xml/main.tsp index b280bbe9758..4beab6443f0 100644 --- a/packages/http-specs/specs/payload/xml/main.tsp +++ b/packages/http-specs/specs/payload/xml/main.tsp @@ -329,5 +329,8 @@ interface XmlErrorValue { ``` """) @get - get(): SimpleModel | XmlError; + get(): { + @header("content-type") contentType: "application/xml"; + @body body: SimpleModel; + } | XmlError; }