Skip to content

Commit

Permalink
fix: generate bigint type instead of BigInt
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlubos committed Jan 15, 2025
1 parent 5585deb commit 51bf7fc
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' });

Check warning on line 421 in packages/openapi-ts/src/plugins/@hey-api/typescript/plugin.ts

View check run for this annotation

Codecov / codecov/patch

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

Added line #L421 was not covered by tests
}
}

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 51bf7fc

Please sign in to comment.