View My JSON
Skip to main content
Blog

JSON numbers that arrive as strings (and quietly break your UI)

Why APIs send "42" instead of 42, how to spot the mismatch in a viewer, and what to do in JavaScript and typed clients before the bug ships.

I have lost count of how many "impossible" UI bugs were a stringly-typed number. The label shows 42. The badge shows 42. The sum shows 4210 because someone wrote total + next and JavaScript concatenated. Validators smile the whole time. This post is about spotting that class of bug early and deciding whether to fix the producer or harden the consumer.

Sources and further reading

Try the JSON workspace