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

Currently, library generating *named* interfaces, enums, types, for root schema and for nested types, when possible (`name = schema.title || schema.$id || keyNameFromDefinition`). e.g. for ```json { "properties": { "food":...

in discussion

Empty enums such as this ```json { "$schema": "http://json-schema.org/draft-07/schema#", "title": "QueryMsg", "type": "string", "enum": [] } ``` produces ```js export type QueryMsg = () ``` which fails as the syntax...

bug
help wanted
good first issue

json-schema-spec PR: https://github.com/json-schema-org/json-schema-spec/pull/737 json-schema doc: https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.9.3 Usage: ``` { "$schema": "http://json-schema.org/draft/2019-09/schema#", "title": "Example Schema", "type": "object", "properties": { "firstName": { "type": "string", "deprecated": true }, }, "additionalProperties": false, "required": [...

enhancement
help wanted
good first issue

This PR adds a new `tsName` schema property that allows a developer to overwrite the default generated name. This is super helpful in cases where two interfaces/types are generated with...

Draft 2019-09 introduces the new keyword `unevaluatedProperties`, which seems not supported in this project yet. A schema with `"unevaluatedProperties": false` will lead to the generated type definition containing an extra...

enhancement
help wanted
good first issue

Currently type names are derived as follow: ``` /** * Compute a schema name using a series of fallbacks */ function standaloneName( schema: JSONSchema, keyNameFromDefinition: string | undefined, usedNames: UsedNames...

enhancement
help wanted
good first issue

Currently, `json-schema-to-typescript` uses a custom `tsEnumNames` extension for naming enum members. However, this extension is specific only to this library. Other major OpenAPI generators ([1](https://openapi-generator.tech/docs/templating/#enum), [2](https://github.com/koxudaxi/datamodel-code-generator/pull/74)) have adopted `x-enum-varnames` for...

Most easily explained with an example, if I have a definition in my schema as follows: ``` "color": { "$id": "#color", "type": "string", "enum": [ "blue", "red", "yellow" ] }...

enhancement
in discussion

When I copy the schema which is also on the [JSON schemas documentation](https://json-schema.org/understanding-json-schema/reference/conditionals.html#id6) it's not recognizing the `postal_code` statements to be included. It's just converting to the following, missing the...

If I specify a property as "either a schema reference or `null`", the `null` type is ignore. For example, the following schemas: ```yaml components: schemas: Foo: type: object properties: bar:...

bug
help wanted