json-schema-to-typescript
json-schema-to-typescript copied to clipboard
`type: null` generated as "any object" record
Schema:
$schema: "https://json-schema.org/draft/2020-12/schema"
type: object
additionalProperties: false
required: [nullProp]
properties:
nullProp:
type: null
Generate with: npx --package=json-schema-to-typescript@^15 json2ts -i schema.yaml -o schema.ts
Produces (minus headers):
export interface Schema {
nullProp: {
[k: string]: unknown;
};
}
Expected:
export interface Schema {
nullProp: null;
}
Workaround: use tsType