You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using JsonValue::parse_with_config, fractional JSON numbers are parsed into Float(f64), so the original literal is lost. Downstream (e.g., pydantic-core’s JsonValidator path) cannot build a Decimal from the original text and only sees f64.to_string(), causing precision loss.
Ask: add an opt‑in mode on the JsonValue parsing path that preserves the raw numeric token (e.g., a lossless number variant or raw text) so consumers can construct Decimal without going through f64.
References:
crates/jiter/src/value.rs: JsonValue enum currently uses Float(f64) for fractional numbers.
pydantic-core invokes JsonValue::parse_with_config in pydantic-core/src/validators/json.rs::JsonValidator.
Context: Workarounds are parsing via PythonParse with FloatMode::Decimal or passing numbers as strings. An opt‑in lossless JsonValue mode would let pydantic-core keep its existing pipeline while preserving precision.
When using
JsonValue::parse_with_config, fractional JSON numbers are parsed intoFloat(f64), so the original literal is lost. Downstream (e.g., pydantic-core’sJsonValidatorpath) cannot build aDecimalfrom the original text and only seesf64.to_string(), causing precision loss.Ask: add an opt‑in mode on the
JsonValueparsing path that preserves the raw numeric token (e.g., a lossless number variant or raw text) so consumers can constructDecimalwithout going throughf64.References:
crates/jiter/src/value.rs:JsonValueenum currently usesFloat(f64)for fractional numbers.JsonValue::parse_with_configinpydantic-core/src/validators/json.rs::JsonValidator.Context: Workarounds are parsing via
PythonParsewithFloatMode::Decimalor passing numbers as strings. An opt‑in losslessJsonValuemode would let pydantic-core keep its existing pipeline while preserving precision.