bcherny/json-schema-to-typescript
View on GitHubAdding anything to empty property makes it `Record<string,any>` instead of `any`
Open
#176 opened on Aug 20, 2018
buggood first issuehelp wanted
Repository metrics
- Stars
- (3,302 stars)
- PR merge metrics
- (No merged PRs in 30d)
Description
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://bepis.com/event.schema.json",
"title": "Event",
"properties": {
"data": {}
},
"additionalProperties": false,
"required": ["data"]
}
produces
export interface Event {
data: any;
}
but
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://bepis.com/event.schema.json",
"title": "Event",
"properties": {
"data": { "description": "" }
},
"additionalProperties": false,
"required": ["data"]
}
immediately produces
export interface Event {
data: {
[k: string]: any;
};
}
Imo, things that don't affect validation should not change the type output?