json-schema-to-typescript icon indicating copy to clipboard operation
json-schema-to-typescript copied to clipboard

Compile JSON Schema to TypeScript type declarations

Results 199 json-schema-to-typescript issues
Sort by recently updated
recently updated
newest added

The following schema: ``` { title: "Foo", properties: { foo: { description: 'Foo is untyped, should allow anything' } } } ``` should become: ``` interface Foo { foo: unknown;...

Seems types give better hints than interfaces, see example in the attached image. So I'm currently generating the interfaces, then changing them to types with a script, all in a...

This pull request introduces changes to handle the `deprecated` property in JSON schemas more effectively. The main updates include modifications to the validation logic, test snapshots, and end-to-end tests. ###...

I have many schema files, some of which contain multiple schemas through $defs i.e. ``` { "$defs": { "CreateThingRequestBody": { "type": "object", "properties": { "title": { "type": "string" } }...

Currently, when a `.d.ts` file is generated, it exports it's symbols. That's good for typescript usage, but when working in plain JavaScript, it is often more convenient to omit those...

feat: add `readonly` option to prepend readonly to fields This feature adds a new `readonly` option to json-schema-to-typescript, enabling users to prepend `readonly` to all fields in generated TypeScript interfaces....

Starting from version 15.0.0, parsing the web types schema with the following script: ```js import { compile } from 'json-schema-to-typescript'; const schema = await fetch('https://json.schemastore.org/web-types').then((response) => response.json()); const ts =...

Given a JsonSchema with nested type with a `oneOf` where the eligible sub-types map to the same typescript type, the resulting typescript type has a duplicate type (eg `string |...

https://github.com/bcherny/json-schema-to-typescript/blob/25c1d2752ff4bad135d6fc53e80c2f99784b0e6f/src/normalizer.ts#L100 In our case, `dereferencedName` could be `#/definitions/v1.ManagedFieldsEntry`, it's not a filename but internal reference name, but `justName` consider it as `filename` always, it should consider `#` character actually. Currently,...