wrong-client-decorator
@azure-tools/typespec-client-generator-core/wrong-client-decoratorSeverity: warning
This diagnostic is issued when @client is applied through an augment decorator instead of directly on a namespace or interface in client.tsp.
Impact
Section titled “Impact”- Area: Explicit client declaration. Generation continues, but the augmented
@clientapplication is ignored because clients must be declared directly. - Not affected: The namespace or interface itself remains in the TypeSpec program.
❌ Incorrect Usage
Section titled “❌ Incorrect Usage”@servicenamespace ServiceNamespace;
namespace ClientNamespace {
}@@client( // `@client` cannot be applied as an augment decorator ClientNamespace, { service: ServiceNamespace, });Diagnostic Message
Section titled “Diagnostic Message”TCGC reports:
@client should decorate namespace or interface in client.tsp✅ How to Fix
Section titled “✅ How to Fix”Place @client directly on the namespace or interface declaration that represents the client:
@servicenamespace ServiceNamespace;
@client({ service: ServiceNamespace,})namespace ClientNamespace {
}Suppression
Section titled “Suppression”Suppress this warning only during a migration where an augmented @client is intentionally ignored and another valid client declaration is used instead.
#suppress "@azure-tools/typespec-client-generator-core/wrong-client-decorator" "augmented @client intentionally ignored"