diff --git a/.chronus/changes/fix_enum_naming-2024-3-1-11-32-16.md b/.chronus/changes/fix_enum_naming-2024-3-1-11-32-16.md new file mode 100644 index 0000000000..190058170a --- /dev/null +++ b/.chronus/changes/fix_enum_naming-2024-3-1-11-32-16.md @@ -0,0 +1,7 @@ +--- +changeKind: fix +packages: + - "@azure-tools/typespec-client-generator-core" +--- + +fix template naming for enums \ No newline at end of file diff --git a/packages/typespec-client-generator-core/src/public-utils.ts b/packages/typespec-client-generator-core/src/public-utils.ts index c4a72aa314..42f76c76f5 100644 --- a/packages/typespec-client-generator-core/src/public-utils.ts +++ b/packages/typespec-client-generator-core/src/public-utils.ts @@ -174,7 +174,10 @@ export function getLibraryName( return ( type.name + type.templateMapper.args - .filter((arg): arg is Model => arg.kind === "Model" && arg.name.length > 0) + .filter( + (arg): arg is Model => + (arg.kind === "Model" || arg.kind === "Enum") && arg.name.length > 0 + ) .map((arg) => pascalCase(arg.name)) .join("") );