Skip to content

Add child client API version overrides - #5157

Draft
Mark Cowlishaw (markcowl) wants to merge 5 commits into
Azure:mainfrom
markcowl:markcowl/override-client-api-version
Draft

Add child client API version overrides#5157
Mark Cowlishaw (markcowl) wants to merge 5 commits into
Azure:mainfrom
markcowl:markcowl/override-client-api-version

Conversation

@markcowl

Copy link
Copy Markdown
Member

Summary

  • add the Legacy @overrideClientApiVersion decorator for interface subclients
  • infer AutoRest info.version when all operations in a document use one override, with mismatch warnings and explicit ARM feature-file precedence
  • propagate child API-version defaults through TypeScript and Go emitters without changing service version enums

Validation

  • affected package builds passed
  • full Client Generator Core, ARM, AutoRest, TypeScript, and Go package test suites passed (TCGC timeout cases passed on isolated rerun)
  • formatting, linting, spelling, Chronus, lockfile, and diff checks passed
  • affected Client Generator Core and ARM documentation regeneration passed

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f21ed198-f6d8-4a45-ab56-25dbec549540
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f21ed198-f6d8-4a45-ab56-25dbec549540
@microsoft-github-policy-service microsoft-github-policy-service Bot added lib:azure-resource-manager Issues for @azure-tools/typespec-azure-core library emitter:autorest Issues for @azure-tools/typespec-autorest emitter emitter:go Issues for @azure-tools/typespec-go emitter emitter:typescript Issues for @azure-tools/typespec-ts emitter lib:tcgc Issues for @azure-tools/typespec-client-generator-core library meta:website TypeSpec.io updates labels Aug 5, 2026
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • @azure-tools/typespec-autorest
  • @azure-tools/typespec-azure-resource-manager
  • @azure-tools/typespec-client-generator-core
  • @azure-tools/typespec-go
  • @azure-tools/typespec-ts
Show changes

@azure-tools/typespec-autorest - feature ✏️

Honor client API-version overrides in emitted OpenAPI documents and warn when a document has inconsistent overrides.

@azure-tools/typespec-azure-resource-manager - feature ✏️

Add a version option to @featureFileOptions for overriding the generated client API version.

@azure-tools/typespec-go - feature ✏️

Generate Go clients with the API-version default configured for each client.

@azure-tools/typespec-client-generator-core - feature ✏️

Add the legacy @overrideClientApiVersion decorator and expose per-client API-version defaults to emitters.

@azure-tools/typespec-ts - feature ✏️

Generate TypeScript clients with the API-version default configured for each client.

@pkg-pr-new

pkg-pr-new Bot commented Aug 5, 2026

Copy link
Copy Markdown

Open in StackBlitz

@azure-tools/typespec-autorest

npm i https://pkg.pr.new/@azure-tools/typespec-autorest@5157

@azure-tools/typespec-azure-resource-manager

npm i https://pkg.pr.new/@azure-tools/typespec-azure-resource-manager@5157

@azure-tools/typespec-client-generator-core

npm i https://pkg.pr.new/@azure-tools/typespec-client-generator-core@5157

@azure-tools/typespec-go

npm i https://pkg.pr.new/@azure-tools/typespec-go@5157

@azure-tools/typespec-ts

npm i https://pkg.pr.new/@azure-tools/typespec-ts@5157

commit: 7bb9222

@azure-sdk-automation

Copy link
Copy Markdown
Contributor

You can try these changes here

🛝 Playground 🌐 Website

Validate root-client API version overrides while constructing the SDK package so TypeSpec validation does not eagerly build the client graph or duplicate unrelated diagnostics.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f21ed198-f6d8-4a45-ab56-25dbec549540
Keep client override validation in the TypeSpec validation hook, but determine explicit client ancestry directly from scoped decorator state so validation does not emit SDK graph diagnostics early or twice.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f21ed198-f6d8-4a45-ab56-25dbec549540
@microsoft-github-policy-service microsoft-github-policy-service Bot added the stale Mark a PR that hasn't been recently updated and will be closed. label Aug 20, 2026
@microsoft-github-policy-service

Copy link
Copy Markdown

Hi @Mark Cowlishaw (@markcowl). Your PR has had no update for 14 days and it is marked as a stale PR. If it is not updated within 14 days, the PR will automatically be closed. If you want to refresh the PR, please remove the stale label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:autorest Issues for @azure-tools/typespec-autorest emitter emitter:go Issues for @azure-tools/typespec-go emitter emitter:typescript Issues for @azure-tools/typespec-ts emitter lib:azure-resource-manager Issues for @azure-tools/typespec-azure-core library lib:tcgc Issues for @azure-tools/typespec-client-generator-core library meta:website TypeSpec.io updates stale Mark a PR that hasn't been recently updated and will be closed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant