Discussion about this post

User's avatar
Rohan's avatar

a schema-valid employee id that doesn't actually exist is exactly the bug that bit us. do you check against the db right after parsing?

Abhishek Pan's avatar

The max_tokens case bites hardest on long line-item arrays, since the cut-off lands mid-array and a lenient JSON repair step will happily close the brackets and hand you half an invoice. Checking that the line items sum to the stated total catches that one and the hallucinated-amount case in the same pass.

1 more comment...

Ready for more?