Skip to content

feat(openapi-typescript): map OpenAPI int64 formats to bigint#2690

Open
umbrik wants to merge 2 commits intoopenapi-ts:mainfrom
umbrik:feat/map-int64-to-bigint
Open

feat(openapi-typescript): map OpenAPI int64 formats to bigint#2690
umbrik wants to merge 2 commits intoopenapi-ts:mainfrom
umbrik:feat/map-int64-to-bigint

Conversation

@umbrik
Copy link

@umbrik umbrik commented Mar 16, 2026

Changes

This PR updates openapi-typescript to map OpenAPI format: int64 values to TypeScript bigint instead of number.

  • Added a shared BIGINT TypeScript AST keyword node.
  • Updated schema transformation logic so type: integer/type: number with format: int64 emit bigint.
  • Added/updated tests to cover:
    • integer + int32number
    • integer + int64bigint
    • number + int64bigint
    • nullable int64 cases → bigint | null
    • path parameter snapshots affected by int64
  • Regenerated examples to reflect new int64 output (e.g. IDs now appear as bigint).

Related issue(s): N/A

How to Review

  • Review the core transformation change for numeric schemas with format: int64.
  • Review added test cases for number/integer format handling and nullable behavior.
  • Verify updated snapshots/examples are consistent with expected int64bigint behavior.
  • Optional local verification:
    • pnpm --filter openapi-typescript test

Checklist

  • Unit tests updated
  • docs updated
  • pnpm run update:examples run (only applicable for openapi-typescript)

@umbrik umbrik requested a review from a team as a code owner March 16, 2026 22:05
@umbrik umbrik requested a review from duncanbeevers March 16, 2026 22:05
@netlify
Copy link

netlify bot commented Mar 16, 2026

👷 Deploy request for openapi-ts pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit c7ae01c

@changeset-bot
Copy link

changeset-bot bot commented Mar 16, 2026

🦋 Changeset detected

Latest commit: c7ae01c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
openapi-typescript Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant