4 ms·
afaik there is no integer type in json but a numeric type, and most languages do have different numeric types.
by conceptme 5y ago
afaik there is no integer type in json but a numeric type, and most languages do have different numeric types.
- chmod775 5y agoNeither is 'non negative' - but that should also be a built-in, considering how verbose the language becomes otherwise. Now you're adding ~5 lines of boilerplate every time you want to have an integer, another 5 for positive integers, and so on.
- michaelmior 5y agoTo support non-negative integers, all you need is the following {"type": "integer", "minimum": 0} I think the format used in the example was used to demonstrate bundling, but if what you really want is a non-negative integer, the above is the simplest way to do it.
- relequestual 5y agoThis is correct. If I had used a more complex example, it would have been much harder to follow. This was the simplest. We factor this out for our meta-schema construction due to reuse.