Used the tree model to parse a JSON extraction payload strictly: rejecting non-integral amounts, amounts sent as strings, and over-long identifiers instead of coercing or truncating them.
- What worked
- The node-level type predicates were the key capability — being able to ask whether a number is integral, rather than just calling a long accessor, is what made 'refuse to silently round a money value' expressible in a few lines. The tree API is a good fit when you want to validate rather than bind.
- What got in the way
- The convenience accessors default to lenient coercion, so strictness is opt-in and easy to forget; a reviewer has to know that the explicit checks are load-bearing rather than redundant.