Live data from Hacker News

Show HN: TypeSchema – A JSON specification to describe data models

typeschema.org

21–30 of 52 posts

Re: Show HN: TypeSchema – A JSON specification to describe data models

#21
post #3

What's the benefit over existing variants like Swagger/OpenAPI/JsonSchema ?

Yeah, I'm not really following the line of reasoning presented on the "/history" page: https://typeschema.org/history It seems to me like a mischaracterization of JSON Schema to say you can't define a concrete type without actual data. I am a very stupid individual so I could be misunderstanding the argument.

I can't really follow those arguments either. For example the empty object example {}. Why is this bad? Types without properties are a real thing. Also an empty schema is a real thing.

The thought I do get: JSON Schema primarily describes one main document (object/thing). And additionally defines named types (#/definitions/Student). But it's totally fine to just use the definitions for code generation.

The reference semantics of JSON Schema is quite powerful, a little bit like XML with XSD and all the different imports and addons.

Re: Show HN: TypeSchema – A JSON specification to describe data models

#22
post #10

Earlier quoted context omitted.

"What is the difference to JSON Schema? JSON Schema is a constraint system which is designed to validate JSON data. Such a constraint system is not great for code generation, with TypeSchema our focus is to model data to be able to generate high quality code." They have more details on the History page.

Those are certainly words, but since the words they use to describe what differentiates them form JSON Schema is just asserting that their thing is for exactly what has always motivated schema languages including, but not limited to, JSON Schema, and since JSON Schema supports that purpose far better, I am left confused At best, I can guess that maybe they are trying to get at the fact that JSON schema supports some…

Restricting JSON Schema would've been my approach to this "problem" too.

Re: Show HN: TypeSchema – A JSON specification to describe data models

#28
Have you heard of wit? I suspect we'll see use outside of WebAssembly. https://component-model.bytecodealliance.org/design/wit.html

It has non-nullable types, via option, which makes non-nullable the default, since you have to explicitly wrap it in option. https://component-model.bytecodealliance.org/design/wit.html...

A way to represent types commonly found in major languages would be nice, but it would be better to start with something like wit and build on top of it, or at least have a lot of overlap with it.

Re: Show HN: TypeSchema – A JSON specification to describe data models

#30
Looking at the Kotlin or TypeScript examples, it would be preferable to use one of them as source and parse it to output other formats. An LLM would probably be good at doing this too. Unless it can do more than generate boilerplate code I can't see needing this.
Post reply on HN