Skip to content

missing-scope

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

Severity: error

This diagnostic is issued when a decorator that is likely language-specific is used without a language scope; currently this is reported for external @alternateType metadata without a scope.

  • Area: Language-specific alternate-type customization. Blocks external type metadata that lacks a target emitter scope, preventing it from being applied globally by accident.
  • Not affected: The TypeSpec type definition and service payload schema are unchanged.
@alternateType({
// external alternate type is missing a language scope
identity: "pystac.Collection",
package: "pystac",
minVersion: "1.13.0",
})
model ItemCollection {}

TCGC reports:

@scope decorator should be applied with @alternateType since it is highly likely this is language-specific

Provide the appropriate language scope argument, such as "python", "csharp", or another emitter scope:

@alternateType(
{
identity: "pystac.Collection",
package: "pystac",
minVersion: "1.13.0",
},
"python"
)
model ItemCollection {}