Skip to content

Wrong schema generated for generics  #173

Open
@rp-work

Description

@rp-work

Hi,
I try to use the tool to generate schema for a generic interface which contains a map.
Here is my strip down interface ts code

interface Base\<dummy\> {
	map: { [key: string]: dummy };
}

interface Test extends Base\<string\> {
}

The tool generates the following schema for type Test

{
    "$ref": "#/definitions/Test",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "definitions": {
        "Test": {
            "properties": {
                "map": {
                    "additionalProperties": {
                        "$ref": "#/definitions/dummy"
                    },
                    "type": "object"
                }
            },
            "type": "object"
        },
        "dummy": {
            "type": "object"
        }
    }
}

I would expect the type of dummy be string instead of object.
Is this a bug ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions