4 ms·
Oh please, no auto casting. It's given way more problems that those that have solved (looking at you Excel). If you want to use json, validate, and accept both
by furstenheim 6y ago
Oh please, no auto casting. It's given way more problems that those that have solved (looking at you Excel).
If you want to use json, validate, and accept both 10 and "10" you can use json schema and do:
```
{ "type": ["string", "number"]}
```
Depending on the library and language you could extend the rules to accept a string that can be parsed and throw if not.