Skip to content

feat(http-specs): add HEAD payload scenario with response headers#10194

Merged
weidongxu-microsoft merged 7 commits intomainfrom
copilot/add-e2e-test-scenario
Apr 17, 2026
Merged

feat(http-specs): add HEAD payload scenario with response headers#10194
weidongxu-microsoft merged 7 commits intomainfrom
copilot/add-e2e-test-scenario

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 30, 2026

case from #9809

storage blob is https://github.com/Azure/azure-rest-api-specs/blob/7e31f1df6af1979b18eaf294d239c24e89c3ffd6/specification/storage/Microsoft.BlobStorage/routes.tsp#L819


Adds a new Spector scenario under payload/head covering a HEAD operation that returns Content-Type and x-ms-meta response headers — a pattern common in blob/storage-style APIs that was previously untested.

Changes

  • specs/payload/head/main.tsp — defines Payload.Head service with a single contentTypeHeaderInResponse HEAD operation returning:
    • Content-Type: text/plain; charset=utf-8 header
    • x-ms-meta header via a shared MetadataHeaders alias
alias MetadataHeaders = {
  @header("x-ms-meta")
  metadata?: string;
};

@scenario
@head
@route("/content-type-header-in-response")
op contentTypeHeaderInResponse(): {
  @header("Content-Type")
  contentType?: string;
  ...MetadataHeaders;
};
  • specs/payload/head/mockapi.ts — mock returns 200 with content-type: text/plain; charset=utf-8 and x-ms-meta: hello response headers, no body.
  • spec-summary.md — regenerated to reflect the updated scenario name and endpoint.

Copilot AI and others added 2 commits March 30, 2026 05:22
Co-authored-by: weidongxu-microsoft <53292327+weidongxu-microsoft@users.noreply.github.com>
…gelog

Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/39724eb3-1f39-4fa7-ac6f-8ff2ed9a37f5

Co-authored-by: weidongxu-microsoft <53292327+weidongxu-microsoft@users.noreply.github.com>
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 30, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/http-specs@10194

commit: 49cbf79

@weidongxu-microsoft
Copy link
Copy Markdown
Contributor

@copilot

Validation seems has an error
https://github.com/microsoft/typespec/actions/runs/23729514485/job/69120607236?pr=10194

Maybe we can update in test and mockapi and summary to say return content-type is text/plain; charset=utf-8

… scenario

Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/396839eb-f0c5-46c6-aea3-30bc0b49c85a

Co-authored-by: weidongxu-microsoft <53292327+weidongxu-microsoft@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 30, 2026

@copilot

Validation seems has an error
...

Fixed in 84089d7 — updated content-type to text/plain; charset=utf-8 in mockapi.ts, the @scenarioDoc, and regenerated spec-summary.md.

@azure-sdk
Copy link
Copy Markdown
Collaborator

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 10, 2026

All changed packages have been documented.

  • @typespec/http-specs
Show changes

@typespec/http-specs - feature ✏️

Add HEAD payload e2e test scenario with Content-Type and x-ms-meta response headers

Comment thread packages/http-specs/specs/payload/head/main.tsp Outdated
Comment thread packages/http-specs/specs/payload/head/main.tsp Outdated
…ective

Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/d7eaeb99-9257-44f6-8881-8814f3282da1

Co-authored-by: weidongxu-microsoft <53292327+weidongxu-microsoft@users.noreply.github.com>
@weidongxu-microsoft weidongxu-microsoft added this pull request to the merge queue Apr 17, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 17, 2026
@weidongxu-microsoft weidongxu-microsoft added this pull request to the merge queue Apr 17, 2026
Merged via the queue into main with commit 2c2ac1a Apr 17, 2026
26 of 27 checks passed
@weidongxu-microsoft weidongxu-microsoft deleted the copilot/add-e2e-test-scenario branch April 17, 2026 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lib:http-specs For issues/prs related to the @typespec/http-specs package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants