Hacker GitHub

← All repos

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

Mentions per year 20 mentions · busiest year 2017 (6)
20082026
  1. …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)
  2. …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
  3. 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
  4. https://github.com/YousefED/typescript-json-schema
    comment by bradstewart · 2020-11-21 · in TypeScript 4.1
  5. …to TypeScript - https://github.com/bcherny/json-schema-to-typescript TypeScript to JSON schema - https://github.com/YousefED/typescript-json-schema
  6. …compiler/build step. At the moment, I use a fork of typescript-json-schema ¹ for my purposes. ¹ https://github.com/YousefED/typescript-json-schema
  7. 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…
  8. 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.
  9. …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…
  10. …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…
  11. …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
  12. 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…
  13. …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
  14. …like JSON Schema and validate against that. https://github.com/bcherny/json-schema-to-typescript https://github.com/YousefED/typescript-json-schema
  15. Maybe something like this? https://github.com/YousefED/typescript-json-schema
    comment by styfle · 2017-06-04 · in TypeScript support in Electron
  16. 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
  17. …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
  18. …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
  19. ▲ 3
    Show HN: Generate JSON schema for your Typescript sources
    story by domoritz · 2017-01-26 · 1 comment
  20. …just has a better impedance match to data storage and interchange. [1] http://json-schema.org/ [2] https://github.com/YousefED/typescript-json-schema