Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursive schema with integer type and format: int64 returns incorrect type #1916

Open
akifunal opened this issue Sep 18, 2024 · 0 comments
Open

Comments

@akifunal
Copy link

I've encountered an issue with recursive schemas, where an integer field with format: int64 returns the wrong type when a schema recursively references itself. Specifically, when a schema contains a recursive reference to itself (e.g., through a parent property), the integer field returns number instead of the expected number | bigint .

This issue does not occur when the recursive reference points to a different schema. In those cases, the integer field correctly returns number | bigint.

To Reproduce Steps to reproduce the behavior:

typescriptlang playground

Expected behavior

For an integer field with format: int64, the inferred TypeScript type should be number | bigint | undefined, even when the schema recursively references itself.

Actual behavior

When a schema recursively references itself, the integer field returns only number, omitting bigint.

Environment:

OS: MacOS sequoia 15.0
package-name...: fets@0.8.3
NodeJS: 20.14.0
TypeScript: 5.5.4

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

No branches or pull requests

1 participant