5 ms·
"we still lack a decent high-quality JSON Schema language" Yes. Why?
by 1wd 9y ago
"we still lack a decent high-quality JSON Schema language"
Yes. Why?
- signalsmith 9y agoThe JSON Schema spec was abandoned by its original authors, and was picked up by a series of other people with varying levels of standards experience (myself included). Personally, I had some promising support from my then-employer (including an IETF connection), but then it kind of petered out, and I was buried under other stuff and had to pass it on. The team who picked it up since them seem pretty on-the-ball as far as I can see, so I would still recommend it as a useful project to contribute to. It is supported by some tools - last I heard, Visual Studio could use JSON Schema for autocomplete and validation, as well as a couple of databases. I used to get a few million NPM downloads a month on my validator, so someone's clearly using it.
- beaconstudios 9y agoThere's also the excellent dtsgenerator which converts json schemas to typescript type definitions.
- alexatkeplar 9y agoAs far as I know, Snowplow is one of the largest active users of JSON Schema, and we maintain one of the larger repositories of JSON Schemas on the internet, https://github.com/snowplow/iglu-central https://github.com/snowplow/iglu-central After something of a hiatus, we are re-starting active work on our schema registry technology (https://github.com/snowplow/iglu https://github.com/snowplow/iglu). We'd love to be involved in new design work on the JSON Schema spec. How do we get the old (or new!) band back together?
- hyperpallium 9y agoUnfortunately, power complexes. When more power is needed than json has (e.g. a schema language), there is xml and the xml ecosystem (e.g. xs), with all the tools, features and standards you could possibly want... actually, more. Thus, it is the complexity of xml that keeps json simple. It is the same principle as keeping flies off the dinner table by dumping a pile of manure outside the front door.
- skrebbel 9y agoNo we don't. Typescript is _great_ for this. type Book = { title: string; author: Author; isbn?: string; } //etc It's easier to read and write by humans than JSON-Schema, a large amount of programmers are already familiar with the syntax, and it's pretty self-explanatory to most programmers who are not. Sure, it doesn't have constraints like "maximum string length" and "must start with a capital" etc, but I'd wager that those don't really belong in a schema language anyway. The structure and the types is what matters. Once you got that covered, doing some validation on the content of the values is easy. And you can use a Real Programming Language for it, instead of something half assed.
- styfle 9y ago> doing some validation on the content of the values is easy How can you validate a JSON string to see if it matches a TypeScript declaration?