Skip to content

no-case-mismatch

Id
@azure-tools/typespec-azure-core/no-case-mismatch

Validate that no two types have the same name with different casing.

Validate that no two types have the same name with different casing. Having types that differ only by casing can cause issues in case-insensitive languages and is generally confusing. This applies to models, enums, and unions.

  • Area: SDK

Type names that differ only by casing cannot be generated into most SDK languages.

Two models that differ only by casing:

model FailOverProperties {
priority: int32;
}
model FailoverProperties {
priority: int32;
}

Multiple types with case variations:

model FailOverProperties {}
model FailoverProperties {}
model Failoverproperties {}

Types with meaningfully different names:

model FailedOver {
status: string;
}
model FailOver {
priority: int32;
}

Suppress only if the API somehow allows it, and then rename the types with client SDK decorators. Otherwise make type names unique when compared case-insensitively.