api-version-undefined
@azure-tools/typespec-client-generator-core/api-version-undefinedSeverity: warning
This diagnostic is issued when the api-version emitter option names a version that is not present in the service versioning list.
Impact
Section titled “Impact”- Area: API-version option resolution. Generation continues by falling back to the latest defined service version, which can target a different SDK API version than requested.
- Not affected: The service’s declared version enum and versioned TypeSpec projections are unchanged.
❌ Incorrect Usage
Section titled “❌ Incorrect Usage”@service(#{ title: "Contoso Widget Manager" })@versioned(Contoso.WidgetManager.Versions)namespace Contoso.WidgetManager;
enum Versions { v1, v2, v3,}options: "@azure-tools/typespec-python": api-version: "v4" # v4 is not one of v1/v2/v3Diagnostic Message
Section titled “Diagnostic Message”TCGC reports:
The API version specified in the config: "v4" is not defined in service versioning list. Fall back to the latest version.✅ How to Fix
Section titled “✅ How to Fix”Set api-version to a service version that exists. latest and all are also valid values when those behaviors are intended.
options: "@azure-tools/typespec-python": api-version: "v3"Suppression
Section titled “Suppression”This diagnostic should not be suppressed. Fix the configured api-version value in tspconfig.yaml so it matches the service versioning list, or use latest or all intentionally.