News for hackers. Stuff that matters.
Re:JSON Schema bundling formalised by chmod775 on Friday September 10, 2021 @06:30AM (#28479670)
A yes. Because things like "integer" totally need to be abstracted away into another schema. Couldn't have given this DSL built-ins for the things that are... you know... built into JSON already.

Also bonus points for the apparent lack of shorthands, turning this language into a verbose word salad. I hope there's at least a line of reasoning that explains why some keys are prefixed with '$' and others aren't.

Great way to turn something as beautifully simple as JSON into something abhorrent.

Hey. You know what is better than JSON at being XML? XML.

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.

Re:JSON Schema bundling formalised by Someone on Friday September 10, 2021 @06:57AM (#28479835)
https://json-schema.org/draft/2020-12/json-schema-core.html#...

This document defines a core vocabulary that MUST be supported by any implementation, and cannot be disabled. Its keywords are each prefixed with a "$" character to emphasize their required nature. This vocabulary is essential to the functioning of the "application/schema+json" media type, and is used to bootstrap the loading of other vocabularies.