Skip to content

Add Spector coverage for date-like extensible enum names#11142

Draft
Copilot wants to merge 5 commits into
mainfrom
copilot/http-specs-add-spector-coverage
Draft

Add Spector coverage for date-like extensible enum names#11142
Copilot wants to merge 5 commits into
mainfrom
copilot/http-specs-add-spector-coverage

Conversation

Copilot AI commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

The existing type/enum/extensible coverage only used word-like enum member names, missing regressions where date/version-like names can be coerced when round-tripped through YAML.

  • Extensible enum scenario
    • Added ApiVersionExtensibleEnum with date-like member names and string values:
union ApiVersionExtensibleEnum {
  string,
  `2020-01-01`: "2020-01-01",
  `2021-01-01`: "2021-01-01",
}
  • Spector operations

    • Added GET/PUT coverage for known and unknown API version values under /type/enum/extensible/api-version.
  • Mock API coverage

    • Added matching mock responses and request expectations for "2020-01-01" and "2022-01-01".

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 Jul 2, 2026
Copilot AI and others added 3 commits July 2, 2026 03:33
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>
Copilot AI changed the title [WIP] Add spector coverage for extensible enum with date/version-like names Add Spector coverage for date-like extensible enum names Jul 2, 2026
Copilot AI requested a review from msyyc July 2, 2026 03:35
Copilot finished work on behalf of msyyc July 2, 2026 03:35

@route("/string")
interface String {
@scenario

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot make sure you pass CI

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validated commit 94d19fe: PR check runs show typespec - ci completed successfully. Local focused checks also pass: pnpm -r --filter "@typespec/http-specs..." build, pnpm --filter @typespec/http-specs validate-mock-apis, and Prettier for the changed files.

}

@doc("Service API versions")
union ApiVersionExtensibleEnum {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @iscai-msft was working on a generic special char spec somewehere, I don't think this test belong in this spec, same as we have a SpecialWords one we should have a SpecialChart one which covers those things.

Also api version doesn't make sense here from a core typespec http spec, this is just about having numbers and special chars

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.

[http-specs] Add spector coverage for extensible enum with date/version-like member names

3 participants