miller/test/cases/io-json-io
John Kerl f8b6de7c23
Emit valid JSON numbers for floats like 004.56; document CSV quoting vs. type inference (#2151)
Miller type-inference accepts float formats which the JSON grammar
disallows -- leading zeros like 004.56, leading plus signs, bare leading
or trailing decimal points like .56 or 4., etc. -- and the JSON writer
passed the original text through verbatim, producing invalid JSON.
Leading-zero integers such as 0123456789 were already handled (inferred
as strings), and hex/binary/octal ints were already re-rendered as
decimal for JSON per #1761; this does the same for floats: when a
float string representation is not a valid JSON number, re-render it
(e.g. 004.56 -> 4.56).

Also documents in reference-main-data-types that CSV double-quoting
does not affect type inference, with -S / --infer-none and string()
as the ways to keep such values as strings.

Addresses #1114 and #1293.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 20:19:32 -04:00
..
0001 Use fixed OFMT for multi-platform regression-testing (#988) 2022-03-16 14:44:42 -04:00
0002 Use fixed OFMT for multi-platform regression-testing (#988) 2022-03-16 14:44:42 -04:00
0003 Use fixed OFMT for multi-platform regression-testing (#988) 2022-03-16 14:44:42 -04:00
0004 Distinguish between JSON and JSON Lines formats (#844) 2022-01-09 11:11:54 -05:00
0005 Distinguish between JSON and JSON Lines formats (#844) 2022-01-09 11:11:54 -05:00
0011 Distinguish between JSON and JSON Lines formats (#844) 2022-01-09 11:11:54 -05:00
0020 Distinguish between JSON and JSON Lines formats (#844) 2022-01-09 11:11:54 -05:00
0021 Distinguish between JSON and JSON Lines formats (#844) 2022-01-09 11:11:54 -05:00
0024 Use fixed OFMT for multi-platform regression-testing (#988) 2022-03-16 14:44:42 -04:00
0025 Distinguish between JSON and JSON Lines formats (#844) 2022-01-09 11:11:54 -05:00
0027 Standardize Go-package structure (#746) 2021-11-11 14:15:13 -05:00
0031 Distinguish between JSON and JSON Lines formats (#844) 2022-01-09 11:11:54 -05:00
0032 Distinguish between JSON and JSON Lines formats (#844) 2022-01-09 11:11:54 -05:00
0033 Distinguish between JSON and JSON Lines formats (#844) 2022-01-09 11:11:54 -05:00
0034 Distinguish between JSON and JSON Lines formats (#844) 2022-01-09 11:11:54 -05:00
0035 Distinguish between JSON and JSON Lines formats (#844) 2022-01-09 11:11:54 -05:00
0036 Fix binary data in JSON output (#1626) 2024-08-25 15:00:51 -04:00
0037 Fix binary data in JSON output (#1626) 2024-08-25 15:00:51 -04:00
0038 Allow empty-string keys in JSON and YAML input (#2068) 2026-05-27 20:19:03 -04:00
0039 Allow empty-string keys in JSON and YAML input (#2068) 2026-05-27 20:19:03 -04:00
0040 Emit valid JSON numbers for floats like 004.56; document CSV quoting vs. type inference (#2151) 2026-07-05 20:19:32 -04:00