bcherny/json-schema-to-typescript
View on GitHubSupport for boolean `required` property at attribute level
Open
#440 opened on Feb 21, 2022
buggood first issuehelp wanted
Repository metrics
- Stars
- (3,302 stars)
- PR merge metrics
- (No merged PRs in 30d)
Description
Currently, only the required array at the top of the object definition will result in non optional attributes. However, json-schema draft does support for required as a boolean at the property level
// test.json
{
"type": "object",
"properties": {
"name": {
"type": "string",
"required": true
}
}
}
CURRENT
interface Test {
name?: string
}
EXPECTED
interface Test {
name: string
}