News for hackers. Stuff that matters.
Re:JSON Schema bundling formalised by conceptme on Friday September 10, 2021 @06:32AM (#28479686)
afaik there is no integer type in json but a numeric type, and most languages do have different numeric types.
Re:JSON Schema bundling formalised by chmod775 on Friday September 10, 2021 @06:40AM (#28479727)
Neither 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.

Re:JSON Schema bundling formalised by michaelmior on Friday September 10, 2021 @08:46AM (#28480729)
To 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.

Re:JSON Schema bundling formalised by relequestual on Friday September 10, 2021 @09:09AM (#28480998)
This 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.