Skip to content

Reject unsafe unquoted integer floats#274

Open
fallintoplace wants to merge 1 commit into
anthropics:mainfrom
fallintoplace:fix/json-safe-int-f64
Open

Reject unsafe unquoted integer floats#274
fallintoplace wants to merge 1 commit into
anthropics:mainfrom
fallintoplace:fix/json-safe-int-f64

Conversation

@fallintoplace

Copy link
Copy Markdown
Contributor

Summary

  • reject high-magnitude unquoted decimal/exponent JSON numbers once they arrive as integer-valued f64s
  • keep exact quoted decimal/exponent strings working for full i64/u64 values
  • add regression coverage for the rounded 9007199254740993.0 and exponent forms, including negative i64 cases

Notes

visit_f64 does not expose the original JSON number text, so the parser may already have rounded before the integer visitor runs. The guard keeps small integer-valued float notation working while rejecting larger values that should be quoted for exact parsing.

Tests

  • cargo test -p buffa --all-features json_helpers::tests
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo test --workspace --all-features

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant