Repository navigation
Description
Following the agreed split in #1290 (comment), this tracks the decimal-literal and reader work removed from #1290 and #1291. Those PRs now address exact integral operands and values already supplied as BigDecimal, without changing the default readers.
For example, with {"multipleOf":2}, the decimal literal 9007199254740993.0 can already be rounded by a default reader before validation. The integral spelling 9007199254740993 is covered by the narrowed fix for #1286. The decimal spelling needs a separate reader design.
The follow-up needs to cover:
- Exact decimal literals in JSON and YAML, including string/stream input, location-aware readers, caller-supplied mappers, and the public mapper factories. Explicit YAML floats such as
!!float 1_000must retain their parsing behavior. - Numeric node equality across
multipleOf, bounds,const,enum, anduniqueItems, including FloatNode conversion and equal BigDecimal values with different scales. Location-aware reading must use the same numeric semantics. - Compatibility of
0.0and-0.0: node type, sign, serialization, defaults, and error text. The previous reader prototype changed these, so an exactness fix needs explicit compatibility decisions and tests. - Parsing cost for ordinary machine-generated doubles and long decimal literals on the supported JDKs. Avoid repeated text copies/conversions or parsing an arbitrary-length exponent as a BigInteger.
- Type-loose numeric strings whose exponents exceed BigDecimal's range. The narrowed PRs keep the existing NumberFormatException behavior; a future fix should define bounded parsing and preserve the protected conversion hooks.
- Policy for zero, negative, and non-finite schema divisors and bounds. The narrowed PRs do not introduce new SchemaException checks: zero divisors remain ignored and finite negative divisors retain their existing divisibility behavior.
- Count limits outside the int range, including
minContains/maxContains, consistent handling across count keywords, and accurate error messages.
The reader regressions listed above were found in the earlier PR prototype; they are constraints for a replacement design, not a claim that all are bugs in the unchanged readers. Details of the deferred findings are in #1290 (comment).
Activity
PHJ2000 commentedon Oct 10, 2026
I’d like to start working on the follow-up items in #1293 and want to check how you’d prefer to organize them. Would you prefer separate issues linked from here, or multiple focused PRs against this issue? Either approach works for me.
Hash big numbers by exact value and keep shortest-form comparison for…
Hash big numbers by exact value and keep shortest-form comparison for…
Compare uniqueItems items without copying them (#1305)
[2.x] Compare uniqueItems items without copying them (#1306)
stevehu commentedon Oct 13, 2026
Thanks for offering to take these on, and for seeing #1290/#1291 through. Both are now merged (
47d2fe6onmaster,f2387c2on2.x).I'd prefer separate focused issues linked from here, each fixed by its own small PR pair (
master+2.x, merged together as before). Let's keep #1293 as the tracking issue with a checklist. Separate issues keep each review small and let the risky reader work move at its own pace without blocking the simpler items.Two items already have issues, so please link these rather than opening new ones:
const,enumanduniqueItems: Share numeric equality across const, enum and uniqueItems; cache numberKind in uniqueItems #1307.uniqueItemsalready compares numbers by value since [2.x] Compare uniqueItems numbers by value (backport #1273) #1301/Compare uniqueItems items without copying them #1305/[2.x] Compare uniqueItems items without copying them #1306, so Share numeric equality across const, enum and uniqueItems; cache numberKind in uniqueItems #1307 is about sharing that logic withconst/enum.multipleOf: 1e400throwing on2.xand the1E+2message.Suggested order:
Small, independent items first: multipleOf: divisor shown as 1E+2 in messages; 2.x throws on a divisor that overflows double #1328, count limits outside the
intrange (minContains/maxContainsand the other count keywords), bounded parsing for type-loose numeric strings with huge exponents, and the policy for zero/negative/non-finite divisors and bounds.Share numeric equality across const, enum and uniqueItems; cache numberKind in uniqueItems #1307 next.
Exact decimal literals in the readers last. It changes what the default and public mappers produce, so before writing code, please post a short design in its issue. It should cover:
0.0/-0.0and YAML!!float;Once we agree on the design, the implementation review will go much faster.
Changes that alter validation results with the default settings need a CHANGELOG entry. Ones that only affect custom validators are fine in a minor release, with a note.
PHJ2000 commentedon Oct 14, 2026
Thanks for the guidance, and for reviewing #1290 and #1291 through all the rounds. I’ll follow the approach you suggested and start by looking into #1328, with separate PRs for master and 2.x. For the reader changes, I’ll post a short design for discussion before starting the implementation.
PHJ2000 commentedon Oct 19, 2026
Thanks for reviewing and merging #1329 and #1330. I’ve opened #1334 for count and length limits beyond the int range. The same narrowing conversion affects all eight related keywords. I’ll take this up next and prepare separate fixes for master and 2.x.
PHJ2000 commentedon Oct 23, 2026
Hi @stevehu, I’ve reviewed #1341 and #1342 and posted my verification results in #1334. I’d like to continue with the remaining follow-ups.
I noticed #1293 was closed as completed. We previously discussed keeping it as the tracking issue, and there are still remaining items, including #1307, bounded parsing for type-loose numeric strings with huge exponents, divisor/bound policies, and the exact-decimal reader design.
Could we reopen #1293 to track those items while addressing them through separate focused issues and PR pairs, as discussed? If you’d prefer to track the remaining work only in separate issues, I’m happy to follow that approach.
stevehu commentedon Oct 23, 2026
Closing this tracking issue and moving the one remaining piece to #1357.
Done from this list:
intrange, includingminContains/maxContainsand accurate messages: Count and length limits beyond int range throw on master or wrap on 2.x #1334 (Preserve count and length limits beyond int range #1341/[2.x] Preserve count and length limits beyond int range #1342), Follow-ups for count-limit handling (#1334): parser field-name matching and MinPropertiesValidator reparse #1346 (Preserve literal numeric behavior for count-named fields (#1346) #1347/Preserve literal numeric behavior for count-named fields on 2.x (#1346) #1348) and Keep exact count-limit values in the schema node instead of a side table #1350 (Preserve exact count values in copied schema trees #1351/Preserve exact count values in copied schema trees (2.x) #1352).const,enumanduniqueItems, including equal BigDecimal values with different scales and FloatNode conversion: Share numeric equality across const, enum and uniqueItems; cache numberKind in uniqueItems #1307 (Share numeric value equality across validation keywords (#1307) #1343/[2.x] Share numeric value equality across validation keywords (#1307) #1344).0.0/-0.0unaffected: Keep exact count-limit values in the schema node instead of a side table #1350.Remaining: the default readers still round decimal-spelled numbers beyond double precision for
multipleOfand numeric bounds (for example9007199254740993.0). That reader design, together with the0.0/-0.0, parsing-cost and YAML/mapper constraints from this issue, is now #1357. The divisor and bound policy questions are not part of it; they keep their current behaviour unless someone opens a separate decision.@PHJ2000, thank you for the follow-ups. #1357 is the item to pick up if you would like to continue; as agreed, a short design note there before the implementation would be best.
🤖 Generated with Claude Code