Skip to content

external-library-version-mismatch

Id
@azure-tools/typespec-client-generator-core/external-library-version-mismatch

Severity: warning

This diagnostic is issued when external @alternateType metadata refers to the same external package with more than one minimum version.

  • Area: Language-specific external type dependencies. Generation continues, but the targeted emitter may receive conflicting minimum versions for the same external package.
  • Not affected: The TypeSpec source types and service payload schema are unchanged.
@alternateType(
{
identity: "pystac.Item",
package: "pystac",
minVersion: "1.12.0",
},
"python"
)
model Item {}
@alternateType(
{
identity: "pystac.Collection",
package: "pystac",
minVersion: "1.13.0", // mismatches the earlier `pystac` minVersion `1.12.0`
},
"python"
)
model Collection {}

TCGC reports:

External library version mismatch. There are multiple versions of pystac: 1.12.0 and 1.13.0. Please unify the versions.

Use one package version for all external alternate type declarations that reference the same package.

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

This diagnostic should not be suppressed. Consolidate the dependency to a single version across the referenced packages.