Skip to content

Comments

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

Draft
Copilot wants to merge 7 commits intomainfrom
copilot/add-spector-case-special-word
Draft

Add spector case for extensible enum with special word member names#9785
Copilot wants to merge 7 commits intomainfrom
copilot/add-spector-case-special-word

Conversation

Copy link
Contributor

Copilot AI commented Feb 24, 2026

  • Add extensible enum (union) with 33 special word member names to special-words/main.tsp
  • Simplify to single @put operation per reviewer feedback
  • Add Enum return type so mock API echoes back the sent value
  • 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
  • Regenerate spec-summary
  • 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
Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
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
Contributor

msyyc commented Feb 24, 2026

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

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

Copilot AI commented Feb 24, 2026

@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.

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.

2 participants