Skip to content

Commit 51bf7fc

Browse files
committed
fix: generate bigint type instead of BigInt
1 parent 5585deb commit 51bf7fc

File tree

5 files changed

+9
-4
lines changed

5 files changed

+9
-4
lines changed

.changeset/healthy-ways-juggle.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@hey-api/openapi-ts': patch
3+
---
4+
5+
fix: generate bigint type instead of BigInt

packages/openapi-ts/src/plugins/@hey-api/typescript/plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ const numberTypeToIdentifier = ({
418418
if (schema.type === 'integer' && schema.format === 'int64') {
419419
// TODO: parser - add ability to skip type transformers
420420
if (context.config.plugins['@hey-api/transformers']?.bigInt) {
421-
return compiler.typeReferenceNode({ typeName: 'BigInt' });
421+
return compiler.typeReferenceNode({ typeName: 'bigint' });
422422
}
423423
}
424424

packages/openapi-ts/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format/types.gen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
export type Foo = {
44
bar?: number;
5-
foo: BigInt;
5+
foo: bigint;
66
id: string;
77
};
88

packages/openapi-ts/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format/types.gen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
export type Foo = {
44
bar?: number;
5-
foo: BigInt;
5+
foo: bigint;
66
id: string;
77
};
88

packages/openapi-ts/test/__snapshots__/3.1.x/plugins/@hey-api/transformers/type-format/types.gen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
export type Foo = {
44
bar?: number;
5-
foo: BigInt;
5+
foo: bigint;
66
id: string;
77
};
88

0 commit comments

Comments
 (0)