ts-json-schema-generator icon indicating copy to clipboard operation
ts-json-schema-generator copied to clipboard

Mapped type based on interface method is empty

Open panstromek opened this issue 3 years ago • 0 comments

When trying to generate schema for mapped type like this, I get just an empty object:


export interface Functional {
    fun(): string
}

export type FunctionalReturnTypes = {
    [Key in keyof Functional]: ReturnType<Functional[Key]>
}

Note: even if I replace the ReturnType<Functional[Key]> with just string, the schema is empty, so it seems like the culprit is that the base interface is functional.

panstromek avatar Mar 12 '22 11:03 panstromek