You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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 returnsnumber
instead of the expectednumber | 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
The text was updated successfully, but these errors were encountered: