Skip to content

Commit

Permalink
(fix): check enum name uniqueness by using lowrcase
Browse files Browse the repository at this point in the history
  • Loading branch information
dsinghvi committed Mar 29, 2024
1 parent eab52c9 commit 9586409
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/cli/openapi-ir-to-fern/src/buildTypeDeclaration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,9 @@ export function buildEnumTypeDeclaration(schema: EnumSchema): ConvertedTypeDecla
};
for (const enumValue of enumSchema.enum) {
const name = typeof enumValue === "string" ? enumValue : enumValue.name ?? enumValue.value;
if (!uniqueEnumName.has(name)) {
if (!uniqueEnumName.has(name.toLowerCase())) {
uniqueEnumSchema.enum.push(enumValue);
uniqueEnumName.add(name);
uniqueEnumName.add(name.toLowerCase());
} // TODO: log a warning if the name is not unique
}
return {
Expand Down

0 comments on commit 9586409

Please sign in to comment.