json-schema-to-typescript
json-schema-to-typescript copied to clipboard
Add support for `unevaluatedProperties` keyword
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 [k: string]: unknown; field, which is expected not to be seen.
Reproduction
Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"title": "Foo",
"properties": {
"bar": {
"type": "string"
}
},
"unevaluatedProperties": false
}
yields
export interface Foo {
bar?: string;
[k: string]: unknown;
}
which is expected to be
export interface Foo {
bar?: string;
}
instead.
@bcherny Boris, what do you think about this?
Yes that would be super cool, thanks 🎉
Is there anyone working on this? I'd love to have a try.