json-schema-to-typescript
json-schema-to-typescript copied to clipboard
Compile JSON Schema to TypeScript type declarations
We're currently working on some ESM-based tooling (we're going pure ESM there), and in the process of migrating existing code into that cleaned-up code base we've stumbled upon some challenges...
I'm trying to generate ts for several files, using the example in the readme: ``` json2ts -i 'schemas/**/*.json' # or json2ts -i schemas/ -o types/ ``` However I'm only able...
I am trying to define a JSON schema for expressions (similar to what Mongo does). ``` { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "$ref": "#/definitions/expression" }, "definitions": { "fieldExpression": {...
https://github.com/bcherny/json-schema-to-typescript/blob/d898361ff973d3746ea695f1efce75c975061c6f/src/utils.ts#L164 The member of type name is restricted to only english letters (and some symbol) Typescript now allows unicode characters ([doc link](https://www.typescriptlang.org/docs/handbook/release-notes/overview.html#better-unicode-support-for-identifiers)) So, modify this function to allow unicode characters...
This JSON Schema: ```json { "title": "MyObject", "type": "object", "properties": { "ingest": { "type": "array", "minItems": 2, "maxItems": 2, "items": [ { "type": "string" }, { "type": "number" } ]...
What are the differences between this library and [json-schema-to-ts](https://github.com/ThomasAribart/json-schema-to-ts)?
I'm not sure if support for the `ipv6` format was implemented or if it was intended to be implemented, but using a `string` prop with an `anyOf` `[{format: 'hostname'}, {format:...
Revisiting [PR401](https://github.com/bcherny/json-schema-to-typescript/pull/401) to add bigint support. Hopefully this PR addresses the outstanding comments on the original PR.
Consider the following JSON schema files: `foo.schema.json` ```json { "title": "Foo", "oneOf": [ { "$ref": "./bar.schema.json" } ] } ``` `bar.schema.json` ```json { "title": "Bar", "type": "string" } ``` Compiling...