conflicting-scope
@azure-tools/typespec-client-generator-core/conflicting-scopeSeverity: warning
This diagnostic is issued when a decorator’s typed options bag (e.g. ClientOptions.scope on
@client) and its legacy positional scope argument both specify a scope, but the two values
disagree.
Impact
Section titled “Impact”- Area: Scoped decorator resolution. TCGC uses the value specified in the options bag and ignores the legacy positional argument.
- Not affected: Decorators that only specify a scope through one of the two mechanisms are unaffected.
❌ Incorrect Usage
Section titled “❌ Incorrect Usage”@client( { service: MyService, scope: "csharp", }, "python")interface MyInterface {}Diagnostic Message
Section titled “Diagnostic Message”TCGC reports:
@client received conflicting scope values: the options bag specifies "csharp" while the legacy positional argument specifies "python". The options bag value will be used; the legacy positional argument is ignored.✅ How to Fix
Section titled “✅ How to Fix”Specify the scope in only one place, or make sure both agree:
@client({ service: MyService, scope: "csharp",})interface MyInterface {}@client( { service: MyService, }, "csharp")interface MyInterface {}