Issue Type
quicktype output (number-kind inference from JSON input).
Context (Environment, Version, Language)
Input Format: JSON
Output Language: Go, C# (likely any language that distinguishes integer from floating-point types)
CLI, npm, or app.quicktype.io: CLI (npm)
Version: 25.0.0-pre1 (also reproduces on 24.0.2)
Description
An integer literal in the input JSON that is outside the int64 range is still classified as an integer, so Go gets int64 and C# gets long. The generated code then fails at runtime on the exact sample it was generated from.
Steps to Reproduce
echo '{"big": 9223372036854775807, "bigger": 123456789012345678901234567890}' > big.json
quicktype big.json -l go -t Edge --package main > edge.go
Generated:
Big int64 `json:"big"`
Bigger int64 `json:"bigger"` // value is ~1.23e29, max int64 is ~9.2e18
Feeding big.json back into UnmarshalEdge:
json: cannot unmarshal number 123456789012345678901234567890 into Go struct field Edge.bigger of type int64
C# similarly emits public long Bigger { get; set; }.
Expected Behavior
A whole number outside the int64 range should not be classified as an integer — it should fall back to float64/double (or a big-integer type where the target has one), so that generated code can round-trip the input it was derived from.
Related: #2648 (TypeScript BigInt support), #2790 (smarter integer sizing for Rust) — both are enhancements about richer integer types; this issue is narrower: the current classification produces code that fails on its own input.
🤖 Filed with Claude Code
Issue Type
quicktype output (number-kind inference from JSON input).
Context (Environment, Version, Language)
Input Format: JSON
Output Language: Go, C# (likely any language that distinguishes integer from floating-point types)
CLI, npm, or app.quicktype.io: CLI (npm)
Version: 25.0.0-pre1 (also reproduces on 24.0.2)
Description
An integer literal in the input JSON that is outside the int64 range is still classified as an integer, so Go gets
int64and C# getslong. The generated code then fails at runtime on the exact sample it was generated from.Steps to Reproduce
Generated:
Feeding
big.jsonback intoUnmarshalEdge:C# similarly emits
public long Bigger { get; set; }.Expected Behavior
A whole number outside the int64 range should not be classified as an integer — it should fall back to
float64/double(or a big-integer type where the target has one), so that generated code can round-trip the input it was derived from.Related: #2648 (TypeScript BigInt support), #2790 (smarter integer sizing for Rust) — both are enhancements about richer integer types; this issue is narrower: the current classification produces code that fails on its own input.
🤖 Filed with Claude Code