require-versioned-service
@azure-tools/typespec-client-generator-core/require-versioned-serviceSeverity: warning
This diagnostic is issued when @clientApiVersions is applied to a service namespace that is not versioned.
Impact
Section titled “Impact”- Area: API-version decorator validation. Generation continues, but
@clientApiVersionshas no service version list to extend on an unversioned namespace. - Not affected: The unversioned service operations are otherwise generated normally.
❌ Incorrect Usage
Section titled “❌ Incorrect Usage”@service@clientApiVersions(ApiVersions) // namespace is not decorated with `@versioned`namespace My.Service { enum ApiVersions { v1, v2, }}Diagnostic Message
Section titled “Diagnostic Message”TCGC reports:
Service "My.Service" must be versioned if you want to apply the "@clientApiVersions" decorator✅ How to Fix
Section titled “✅ How to Fix”Add TypeSpec versioning to the service namespace or remove @clientApiVersions.
@service@versioned(Versions)@clientApiVersions(ApiVersions)namespace My.Service { enum Versions { v1, v2, }
enum ApiVersions { v1, v2, }}Suppression
Section titled “Suppression”This diagnostic should not be suppressed. Add versioning to the service (with @versioned), or remove @clientApiVersions if the service is not versioned.