Skip to content

Commit

Permalink
Merge pull request #1574 from hey-api/fix/typescript-bigint
Browse files Browse the repository at this point in the history
fix: generate bigint type instead of BigInt
  • Loading branch information
mrlubos authored Jan 15, 2025
2 parents 5585deb + 51bf7fc commit f6c47bb
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/healthy-ways-juggle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hey-api/openapi-ts': patch
---

fix: generate bigint type instead of BigInt
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ const numberTypeToIdentifier = ({
if (schema.type === 'integer' && schema.format === 'int64') {
// TODO: parser - add ability to skip type transformers
if (context.config.plugins['@hey-api/transformers']?.bigInt) {
return compiler.typeReferenceNode({ typeName: 'BigInt' });
return compiler.typeReferenceNode({ typeName: 'bigint' });
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

export type Foo = {
bar?: number;
foo: BigInt;
foo: bigint;
id: string;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

export type Foo = {
bar?: number;
foo: BigInt;
foo: bigint;
id: string;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

export type Foo = {
bar?: number;
foo: BigInt;
foo: bigint;
id: string;
};

Expand Down

0 comments on commit f6c47bb

Please sign in to comment.