Live data from Hacker News

JSON Schema Store

schemastore.org

21–30 of 150 posts

Re: JSON Schema Store

#21

Earlier quoted context omitted.

I wish it had comments. And for that reason, I prefer yaml.

I prefer JSON's strictness. A Boolean cannot be confused for a string. In yaml: country: no Now your country is Boolean(false) Now, I still prefer yaml overall. Also, I hate that GitHub actions don't support anchors.

cries in TOML

Re: JSON Schema Store

#22
post #9

Does anyone know of a typescript translation for each of those validation models? Or maybe even a way to discover related statically typed definitions based on the validation rules? It would be really nice to not define parts of a data model that provide little to no business value - but where you can easily “stub your toe”.

I've been asking chatgpt to do it for me.

Re: JSON Schema Store

#23
post #6
post #5

Took me an embarrassingly long time to figure out you could scroll that list

Same,I like how clean it looks but it needs some visual indicator that it scrolls.

In MacOS, set Show scroll bar to always. https://www.macrumors.com/how-to/make-scroll-bars-always-vis...

Re: JSON Schema Store

#26
post #9

Does anyone know of a typescript translation for each of those validation models? Or maybe even a way to discover related statically typed definitions based on the validation rules? It would be really nice to not define parts of a data model that provide little to no business value - but where you can easily “stub your toe”.

You could use this[0] package but you would need to download the schema first into a folder say "schemas" and then add a build step as a script in your package.json '"compile-schemas": "json2ts -i schemas -o types"' to export to a "type" folder [0] json-schema-to-typescript

If it's a one-off you can just use http://borischerny.com/json-schema-to-typescript-browser/ or https://transform.tools/json-schema-to-typescript (they both use the same library).

Re: JSON Schema Store

#27

Earlier quoted context omitted.

I prefer JSON's strictness. A Boolean cannot be confused for a string. In yaml: country: no Now your country is Boolean(false) Now, I still prefer yaml overall. Also, I hate that GitHub actions don't support anchors.

In YAML 1.2 that gives the string "no".

Huh, that's a breaking change. yes/y/no/n/on/off are no longer boolean.

https://perlpunk.github.io/yaml-test-schema/schemas.html

Re: JSON Schema Store

#30
post #3

JSON is the version of XML we deserve.

Nobody deserves XML! In all seriousness I get the idea behind XML and I have used a couple of SOAP services which were absolutely brilliant, but as someone who has spent a decade “linking” data from various sources in non-tech enterprise… Well… let’s just say that I’m being kind if I say that 5% of the services which used XML were doing it in a way that was nice to work with.

Which is why JSON’s simplicity is such a win for our industry. Because it’s always easy to handle. Sure you can build it pretty terrible, but you’re not going to do this: and then later do x which I’m not convinced you didn’t do in XML because you’re chaotic evil. And you’re not going to run into an issue where some Adobe Lifecycle schema doesn’t work with .Net because of reasons I never really found out because why wouldn’t an XML schema work in .Net? Anyway, I’m sure the intentions behind XML were quite brilliant but in my anecdotal experience it just doesn’t work for the Thursday afternoon programmer mindset and JSON does.

Post reply on HN