Skip to content

Comment on Ultra-minimal JSON schemas with TypeScript inference

Comments

Unfortunately excessively verbose and non-portable to backends other than Node.js.

This is a good start, and what problems does this solve IRL? As in, actual problems that happen? (Not just theoretically possible classes of problems.) I get the narrowest use-case, and then beyond that this seems otherwise doomed to become irrelevant over time rather than gain momentum and become something meaningful in any lasting sense.

Think bigger.

Then the meta solution will become self-evident.

doomed to become irrelevant over time rather than gain momentum and become something meaningful in any lasting sense.

You seem to be jumping from topic to topic without being able to express your thoughts very well.

What do you mean by excessively verbose? They seem to make a point at being minimalist and the comparison with JSON schema in the README page seems to attest to it.

Compared to a struct in C, Rust, Golang, or Java it takes more key presses on behalf of the programmer and only works in (/is optimized for) a narrowly specific set of circumstances.

Convenient in some ways (e.g. if you are only comfortable in JS), and does nothing useful in other contexts.

Nothing inherently wrong with it, other than it seems like a missed opportunity.

Is this more than a subset of Wordnik's Swagger?

https://swagger.io/

Compared to a struct in C (...)

That's hardly a relevant point or meaningful comparison. The discussion is about schema validators for TypeScript/JavaScript.

Why limit to only the (frontend | Node.js)?

Swagger uses JSON Schema to describe the data formats.

https://swagger.io/docs/specification/data-models/keywords/

This is a easier write, easier to read, compatible with JSON Schema alternative. Spartan Schema could be used instead of JSON Schema to make the document easier for humans to work with.

At the core, is this more than a JSON-schema generator bundled with a check function? Could it be >?
Then the meta solution will become self-evident.
Think bigger.

Are you going to share your big idea?

Avro? Protobuf?

Those are not in any way full alternatives to JSON schema

At the core, is this more than a JSON-schema generator bundled with a check function? Could it be >?

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.