Re:Show HN: Instant API – Build type-safe web APIs with Java...
by madeofpalk on Friday October 27, 2023 @06:14AM
(#38036691)
My problem is how you declare the schema. I think the Typescript's teams stance is valid (though, I would love for them to sponsor/release an additional project for more runtime validation using typescript).
I don't want to declare my schema with zod's DSL. I'll either use an openapi spec from elsewhere and generate artefacts from that, or declare them with Typescript and... generate validation from them.
Typescript's types simply aren't able to provide input validation, both because they don't exist at runtime and for lack of power ("number must be 0..10").
At least with Zod, you also get Typescript types, from the same schema.