Skip to content

Add spector case for extensible enum with special word member names - #9785

Merged
Yuchao Yan (msyyc) merged 14 commits into
mainfrom
copilot/add-spector-case-special-word
Mar 6, 2026
Merged

Yuchao Yan (msyyc) merged 14 commits into
mainfrom
copilot/add-spector-case-special-word

Conversation

Copilot AI commented Feb 24, 2026 •

Copy link
Copy Markdown
Contributor
  • Add extensible enum (union) with 33 special word member names to special-words/main.tsp
  • Simplify to single @put operation per reviewer feedback
  • Add ExtensibleString return type so mock API echoes back the sent value
  • Simplify return type to putExtensibleStringValue(@body body: ExtensibleString): ExtensibleString;
  • Add handler to dynamically extract request body and echo it back in response
  • Remove explicit contentType headers (default application/json is sufficient)
  • Remove redundant @doc decorators from union definition for consistency with rest of file
  • Rename union Enum to union ExtensibleString to avoid blocking actual enum tests
  • Rename interface Enums to ExtensibleStrings, route /enums to /extensible-strings, and operation putEnumValue to putExtensibleStringValue
  • Regenerate spec-summary
  • Add chronus changeset for @typespec/http-specs
  • Build validated (61 scenarios pass)
  • Format, code review, and security scan clean

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…ames

Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
@microsoft-github-policy-service microsoft-github-policy-service Bot added the lib:http-specs For issues/prs related to the @typespec/http-specs package label Feb 24, 2026
Copilot AI changed the title [WIP] Add new spector case for special word in enum Add spector case for extensible enum with special word member names Feb 24, 2026
Comment thread packages/http-specs/specs/special-words/main.tsp Outdated
Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
Comment thread packages/http-specs/specs/special-words/main.tsp Outdated
Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
Comment thread packages/http-specs/specs/special-words/mockapi.ts
Comment thread packages/http-specs/specs/special-words/main.tsp Outdated
Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
…n/json

Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
@msyyc

Copy link
Copy Markdown
Contributor

Copilot check all changes of the PR to make sure they are consistent.

Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>

Copilot AI commented Feb 24, 2026

Copy link
Copy Markdown
Contributor Author

Copilot check all changes of the PR to make sure they are consistent.

Reviewed all changes for consistency in f70bb68. Found and fixed one issue: the union Enum definition had redundant @doc decorators on the union itself and on every member, which was inconsistent with the rest of the file (no other types use @doc). Removed them, keeping just the JSDoc comment. All three changed files are now consistent:

  • main.tsp: Union uses JSDoc only (matching existing models/operations), single @put op with Enum input/output, no explicit contentType
  • mockapi.ts: Handler echoes req.body back in response, matching the TSP contract
  • spec-summary.md: Auto-generated, matches the scenario definition

Build passes with 61 valid scenarios.

@msyyc

Copy link
Copy Markdown
Contributor

Copilot fix ci error:

Run pnpm chronus verify --since main
There is undocummented changes. Run chronus add to add a changeset.

The following packages have changes but are not documented.
 - @typespec/http-specs

Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>

Copilot AI commented Feb 26, 2026

Copy link
Copy Markdown
Contributor Author

Copilot fix ci error:

Run pnpm chronus verify --since main

...

Added the chronus changeset for @typespec/http-specs in 9b6d78f.

Comment thread packages/http-specs/specs/special-words/main.tsp Outdated
Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>

Copilot AI commented Feb 27, 2026

Copy link
Copy Markdown
Contributor Author

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • telemetry.astro.build
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/typespec/typespec/website/node_modules/.bin/../astro/astro.js build sh .0/b�� ebsite/src/conte--llmstxt .json /.bin/sh ture 7b6e072b8b5df199/home/REDACTED/work/typespec/typespec/packages/http-specs/node_modules�� in/tsp sh pec/�� ../../website/src/content/docs/d--typekits node _modules/pnpm/dist/node-gyp-bin/sh /library-linter node tsconfig.build.j/home/REDACTED/work/typespec/typespec/packages/http-server-js/node_modules/.bin/..hint modules/@npmcli/doc node (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

…viewer feedback

Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
@msyyc

Copy link
Copy Markdown
Contributor

Hi Timothee Guerin (@timotheeguerin) pls help take a review, thanks!

@msyyc
Yuchao Yan (msyyc) added this pull request to the merge queue Mar 6, 2026
Merged via the queue into main with commit 6d06117 Mar 6, 2026
24 checks passed
@msyyc
Yuchao Yan (msyyc) deleted the copilot/add-spector-case-special-word branch March 6, 2026 07:25
github-merge-queue Bot pushed a commit that referenced this pull request Mar 11, 2026
…9987)

moved from #9953

Follow-up to #9785: the `putExtensibleStringValue` operation was missing
an explicit response content-type header, inconsistent with the pattern
used by other extensible enum endpoints.

- Updated return type in
`packages/http-specs/specs/special-words/main.tsp`:

```typespec
putExtensibleStringValue(@Body body: ExtensibleString): {
    @Header contentType: "application/json";
    @Body body: ExtensibleString;
};
```

> [!WARNING]
>
> <details>
> <summary>Firewall rules blocked me from connecting to one or more
addresses (expand for details)</summary>
>
> #### I tried to connect to the following addresses, but was blocked by
firewall rules:
>
> - `telemetry.astro.build`
> - Triggering command:
`/home/REDACTED/work/_temp/ghcca-node/node/bin/node node
/home/REDACTED/work/typespec/typespec/website/node_modules/.bin/../astro/astro.js
build sh s/.b�� ../../website/sr--llmstxt sh
_modules/pnpm/dist/node-gyp-bin/node --no-emit git
_modules/pnpm/digenerate-scenarios-summary node tobu�� build.json sh
/.bin/sh ld.json &amp;&amp; pnpm node pnpm tobuf/reference node` (dns
block)
>
> If you need me to access, download, or install something from one of
these locations, you can either:
>
> - Configure [Actions setup
steps](https://gh.io/copilot/actions-setup-steps) to set up my
environment, which run before the firewall is enabled
> - Add the appropriate URLs or hosts to the custom allowlist in this
repository's [Copilot coding agent
settings](https://github.com/microsoft/typespec/settings/copilot/coding_agent)
(admins only)
>
> </details>

<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for
you](https://github.com/microsoft/typespec/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

4 participants