**Reject malformed away_number values in JSON imports** #73

Closed
opened 2026-06-03 11:07:40 +02:00 by umpire274 · 0 comments
umpire274 commented 2026-06-03 11:07:40 +02:00 (Migrated from github.com)

Reject malformed away_number values in JSON imports

When a JSON record includes away_number with a non-integer type, such as a quoted string in hand-edited data, and_then(|v| v.as_i64()) turns it into None and this branch silently defaults it to the home number. That produces a successful import with the wrong away jersey number instead of reporting the invalid field; only an actually omitted compatibility field should take this default.

Useful? React with 👍 / 👎.

Originally posted by @chatgpt-codex-connector[bot] in https://github.com/umpire274/bs_scoring/pull/71#discussion_r3347131824

**Reject malformed away_number values in JSON imports** When a JSON record includes `away_number` with a non-integer type, such as a quoted string in hand-edited data, `and_then(|v| v.as_i64())` turns it into `None` and this branch silently defaults it to the home number. That produces a successful import with the wrong away jersey number instead of reporting the invalid field; only an actually omitted compatibility field should take this default. Useful? React with 👍 / 👎. _Originally posted by @chatgpt-codex-connector[bot] in https://github.com/umpire274/bs_scoring/pull/71#discussion_r3347131824_
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
umpire274/bs_scoring#73
No description provided.