3 ms·
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... y
by chmod775 5y ago
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.
- conceptme 5y agoafaik 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.
- Someone 5y agohttps://json-schema.org/draft/2020-12/json-schema-core.html#rfc.section.3 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.