Files
pad/cmd
xarmian 3508a83307 fix(cli): reject NaN/Inf in --field number parsing per Codex review (round 1)
strconv.ParseFloat accepts "NaN", "+Inf", "-Inf" as valid float64 values,
but encoding/json cannot marshal those. The downstream json.Marshal(fields)
errors at cmd/pad/main.go createCmd / updateCmd are intentionally ignored
(`fieldsJSON, _ := json.Marshal(fields)`), so a single malformed --field
input would silently drop the entire fields payload instead of rejecting.

Reject non-finite floats in parseFieldFlag and fall back to the raw string;
the server validator then returns the useful "field X must be a number"
error.

Verified:
  pad item update BLOG-1393 --field reading_time=NaN → "must be a number" ✓
  pad item update BLOG-1393 --field reading_time=Inf → "must be a number" ✓
  pad item update BLOG-1393 --field reading_time=4   → stored as 4         ✓
2026-05-13 04:11:34 +00:00
..