Open afonsof opened 3 months ago
I am experiencing an incorrect typing issue in TypeScript when using Omit on an interface that inherits properties from a grandparent interface.
Steps to Reproduce
optional property
Omit
interface Grandparent { a?: string } interface Parent extends Grandparent { b: string } export type Child = Omit<Parent, 'b'>
{ "definitions": { "Child": { "properties": { "a": {} }, "required": [ "a" ], } } }
The grandparent property should be correctly typed and not be required
correctly typed
not be required
{ "definitions": { "Child": { "properties": { "a": { "type": "string" } } } } }
I have the same issue🙁
Hi! Thanks for the bug report, would you want to open a PR to address this? Remember to add unit tests.
I am experiencing an incorrect typing issue in TypeScript when using Omit on an interface that inherits properties from a grandparent interface.
Steps to Reproduce
optional property
.Omit
to exclude a property from the parent interface.Code Example
Generated output
Expected Behavior
The grandparent property should be
correctly typed
andnot be required