This is why I originally started a project to convert ts to json schema; https://github.com/YousefED/typescript-json-schema (and also check out a good alternative https://github.com/vega/ts-json-schema-generator)
Re:JSON Schema bundling formalised
by panzerklein on Friday September 10, 2021 @07:27AM
(#28480021)
You can write validation schemas using zod library [1]. They end up looking pretty similar to typescript definitions (same vocabulary, same methods for combining/intersecting/filtering). And if you migrate to typescript you'll get type definitions for free out of those schemas.
Re:JSON Schema bundling formalised
by IggleSniggle on Friday September 10, 2021 @08:38AM
(#28480659)
If you like zod, you should check out myzod: https://github.com/davidmdm/myzod
Re:JSON Schema bundling formalised
by anentropic on Friday September 10, 2021 @07:19AM
(#28479961)
you might like https://jsontypedef.com/ if you haven't seen it
https://www.typescriptlang.org/docs/handbook/declaration-fil...