YousefED/typescript-json-schema
View on GitHub ↗ ★ 3,267 TypeScript
Generate json-schema from your Typescript sources
20 mentions on Hacker News by 17 people: 1 story, 19 comments · first 2016-08-01 · latest 2023-03-07
20082026
-
…as the source of truth, I highly recommend the following library: [ts-json-schema-generator]( https://github.com/YousefED/typescript-json-schema ). It does exactly what it says in the box: turns your TypeScript `types` / `interface` into…
comment by bertrand-caron · 2023-03-07 · in Parse, don't validate (2019) -
…for your use case, but you can use typescript-json-schema¹ for this, and validate with eg ajv. ¹ https://github.com/YousefED/typescript-json-schema
comment by yesbabyyes · 2021-11-14 · in YAML: It's Time to Move On -
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 )
comment by YousefED · 2021-09-10 · in JSON Schema bundling formalised -
https://github.com/YousefED/typescript-json-schema
comment by bradstewart · 2020-11-21 · in TypeScript 4.1 -
…to TypeScript - https://github.com/bcherny/json-schema-to-typescript TypeScript to JSON schema - https://github.com/YousefED/typescript-json-schema
comment by lioeters · 2020-07-30 · in Schemastore.org – schemas for all commonly known JSON file formats -
…compiler/build step. At the moment, I use a fork of typescript-json-schema ¹ for my purposes. ¹ https://github.com/YousefED/typescript-json-schema
comment by lioeters · 2020-05-26 · in Show HN: PgTyped – Typesafe SQL in TypeScript and Postgres -
You can generate JSON Schema from TS with this library: https://github.com/YousefED/typescript-json-schema It's certainly conceivable to build an equivalent for Zod but you'll eventually want to validate types that aren't expressible in TS…
comment by colinmcd · 2020-03-12 · in Designing the perfect TypeScript schema validation library -
If you define the types in TS, you can use https://github.com/YousefED/typescript-json-schema to automatically generate a JSON schema from it. That way, configurations can be specified either in an executable JS module or in a JSON file.
comment by ironmagma · 2020-01-05 · in Parcel – Fast, zero-configuration web application bundler -
…and discriminated unions are a very natural way to express algebraic data types in JS. 2. Use https://github.com/YousefED/typescript-json-schema to generate a JSON schema, then use a json schema validator to do runtime validation. That's…
comment by rictic · 2019-09-12 · in TypeScript 3.7: The Biggest Features and How to Use Them -
…json schema can't. It is possible to generate a json schema from a TypeScript definition (see https://github.com/YousefED/typescript-json-schema ), which means TypeScript can be the single source of truth for API definitions, be used…
comment by kiliancs · 2019-04-15 · in Using JSON Schema to Document, Test, and Debug APIs -
…using a generator to create JSON schema definitions. This one has worked really well recently https://github.com/YousefED/typescript-json-schema
comment by jaklfdjkasf · 2018-12-03 · in ForgJs – A lightweight object validator -
An alternative I'm a fan of: using typescript-json-schema: https://github.com/YousefED/typescript-json-schema To turn TypeScript interfaces into JSON schemas, then evaluating incoming JSON using whatever JSON schema validation library you…
comment by untog · 2018-04-20 · in Io-to: both static and dynamic type checking for JSON API data in TypeScript -
…JSON Schema's better tool support. [0] https://en.wikipedia.org/wiki/RELAX_NG#Compact_syntax [1] https://github.com/YousefED/typescript-json-schema
comment by skrebbel · 2018-02-18 · in JSON Schema -
…like JSON Schema and validate against that. https://github.com/bcherny/json-schema-to-typescript https://github.com/YousefED/typescript-json-schema
comment by styfle · 2017-08-09 · in JavaScript for People Who Hate JavaScript -
Maybe something like this? https://github.com/YousefED/typescript-json-schema
comment by styfle · 2017-06-04 · in TypeScript support in Electron -
Typson hasn't been updated for a while, we use https://github.com/YousefED/typescript-json-schema which works with recent typescript coupled with https://github.com/mafintosh/is-my-json-valid
comment by sceutre · 2017-04-28 · in TypeScript 2.3 -
…example model-first in typescript and want to generate JSONSchema: Typescript Code to JSONSchema: https://github.com/YousefED/typescript-json-schema - started this long ago but some great contributors are leading it since!
comment by YousefED · 2017-04-26 · in Show HN: JSONSchema to TypeScript compiler -
…safer and runtime errors more clear. [1] https://github.com/bcherny/json-schema-to-typescript [2] https://github.com/YousefED/typescript-json-schema
comment by whatever_dude · 2017-04-11 · in TypeScript at Slack -
▲ 3
Show HN: Generate JSON schema for your Typescript sourcesstory by domoritz · 2017-01-26 · 1 comment
-
…just has a better impedance match to data storage and interchange. [1] http://json-schema.org/ [2] https://github.com/YousefED/typescript-json-schema
comment by SomeCallMeTim · 2016-08-01 · in How to Avoid Being Called a Bozo When Producing XML (2005)