Skip to content

conflicting-scope

Id
@azure-tools/typespec-client-generator-core/conflicting-scope

Severity: 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.

  • 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.
@client(
{
service: MyService,
scope: "csharp",
},
"python"
)
interface MyInterface {}

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.

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 {}