JSON Numbers vs Strings

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.

Related Guides

An unhandled error has occurred. Reload