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

- Add transform for `nullable: true` to include `null` as a possible type for any of the following schema types: `const`, `enum`, `type`. - Log a warning when `const` is...

From the [JSON Schema 2020-12 Release Notes](https://json-schema.org/draft/2020-12/release-notes.html): > The `items` and `additionalItems` keywords have been replaced with `prefixItems` and `items` where `prefixItems` has the same functionality as the array-of-schemas for...

enhancement
help wanted
good first issue

Given this schema: ``` { "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string" }, "validFrom": { "type": "string" }, "validTo": { "type": "string" } }, "anyOf": [ {...

bug
help wanted

I'm using the CLI as follows: > json2ts -i './*.json' --output -o ../contracts Where in my current directory there are multiple JSON Schema files. In the `contracts` directory I'm getting...

duplicate
enhancement

PR to replace https://github.com/bcherny/json-schema-to-typescript/pull/411 and https://github.com/bcherny/json-schema-to-typescript/pull/312. Adding support for `nullable: true`. Using https://ajv.js.org/json-schema.html#nullable as reference, which states that it is the equivalent of adding `null` as a possible type.

## Reproduction https://github.com/GabenGar/repros ```sh git clone https://github.com/GabenGar/repros ./repros cd repros/nodejs/json-schema-to-typescript-file-path npm install npm run run ``` ## The Problem Despite passing [`$refOptions.resolve.file.read()`](https://github.com/GabenGar/repros/blob/4c89d3101883a9db5f7d67af8058ffbea5a1ad61/nodejs/json-schema-to-typescript-file-path/index.ts#L103) to not perform actual file system look up,...

This is an attempt to fix the issue described in my comment [here](https://github.com/bcherny/json-schema-to-typescript/issues/381#issuecomment-1854154150). Basically, the issue arises when parsing a schema that is a combination of a `oneOf`/`allOf`/... and an...

Hello, I think the following schema should produce the object type with all the properties required: ```json { "type": "object", "additionalProperties": false, "minProperties": 2, "properties": { "a": { "type": "number"...

Correct me if I'm wrong, but nowadays the converter follows the strict rule: make prop optional if it's not in `required` list. But JSON Schema allows using key `default`. Of...