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

In AOS 3 there's provision for `oneOf` being used along with a `discriminator`, which allows specifying an array where the types are discriminated based on a property. https://swagger.io/docs/specification/data-models/oneof-anyof-allof-not/ ``` {...

enhancement
in discussion

### How to reproduce I copied the below snippet and pasted in package json ```javascript { "scripts": { "compile-schemas": "json2ts -i src/**/*.schema.json" } } ``` My project folder structure is...

enhancement
help wanted
good first issue

See https://github.com/bcherny/json-schema-to-typescript/pull/144#discussion_r167442887 cc @qix

enhancement
help wanted
good first issue

Is it possible to support a custom index definition for `additionalProperties`? Currently the output is: `[k: string]: MyInterface`. It would be beneficial if it could be customized like so `[k...

enhancement
in discussion

Can I prevent reference type from expansion? Input JSON: ```json { "properties": { "correct": { "$ref": "#/definitions/color" }, "wrong": { "description": "should be referenced", "$ref": "#/definitions/color" } }, "additionalProperties": false,...

bug
help wanted
good first issue

I am testing `json-schema-to-typescript` and I see that in some cases it produces `interface` and in other cases `type`. What is the rule here, when does it make which? Is...

question
in discussion

Forgive me if this is a duplicate of https://github.com/bcherny/json-schema-to-typescript/issues/132 or another issue; I searched by didn't find anything. I was hoping to be able to have both a comment about...

bug
help wanted
good first issue

There are some points where `tsEnumNames` could be enhanced: - JSON is ~~usually~~ often `snake_case`. Allow ts_enum_names. - JSON Editor uses `enum_titles` for a [similar scenario](https://github.com/jdorn/json-editor#editor-options). Allow both or adopt....

enhancement
help wanted

adds the option to use an url as input to the CLI - uses `validator.isURL()` to test if the input is a valid fully qualified URL. - uses `axios` to...

Both the following schemas ``` { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Empty", "type": "object", "additionalProperties": false } ``` ``` { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Empty", "type": "object", "additionalProperties": false, "properties": { } }...

bug
help wanted
good first issue