diff --git a/packages/core/src/getters/scalar.ts b/packages/core/src/getters/scalar.ts index 38585af37..1d217ab15 100644 --- a/packages/core/src/getters/scalar.ts +++ b/packages/core/src/getters/scalar.ts @@ -28,7 +28,10 @@ export const getScalar = ({ switch (item.type) { case 'number': case 'integer': { - let value = item.format === 'int64' ? 'bigint' : 'number'; + let value = + item.format === 'int64' && context.override.useBigInt + ? 'bigint' + : 'number'; let isEnum = false; if (item.enum) { diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 9cb452035..df33b9d4d 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -100,6 +100,7 @@ export type NormalizedOverrideOutput = { useDates?: boolean; useTypeOverInterfaces?: boolean; useDeprecatedOperations?: boolean; + useBigInt?: boolean; }; export type NormalizedMutator = { @@ -278,6 +279,7 @@ export type OverrideOutput = { useDates?: boolean; useTypeOverInterfaces?: boolean; useDeprecatedOperations?: boolean; + useBigInt?: boolean; }; export type OverrideOutputContentType = {