JSON Numbers vs Strings
TL;DR: Values like "42" are strings, not numbers.
They often slip through client validation but fail on the server, or cause subtle comparison bugs.
Common Problem: Loose Typing
{
"age": "42", // string
"age": 42 // number
}
Many APIs and ORMs expect numeric fields to be real JSON numbers. When they arrive as strings, you may see:
- Deserialization errors or default values instead of the intended number.
- Validation rules that never trigger because the value is treated as text.
- Sorting and comparison bugs where
"100"sorts before"9".
How JSON Runtime Checker Helps
The JSON Runtime Checker
looks for string values that look like numbers (for example "1" and "0") and surfaces them
as risky patterns so you can align your payloads with your models.
Audit Your JSON Numbers
Paste your payload into the JSON Runtime Checker to spot where numeric fields are actually strings, and adjust either your contracts or your data.