-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong schema generated for generics #173
Comments
Yes, this looks like a bug. My other project, https://github.com/vega/ts-json-schema-generator, generates the correct schema so you could use that instead. {
"$ref": "#/definitions/MyObject",
"$schema": "http://json-schema.org/draft-04/schema#",
"definitions": {
"MyObject": {
"additionalProperties": false,
"properties": {
"map": {
"additionalProperties": {
"type": "string"
},
"type": "object"
}
},
"required": [
"map"
],
"type": "object"
}
}
} |
Thanks for reply. |
Unfortunately the ts-json-schema-generator tool has other issues which prevents me from using it at the moment. Any chance to get this issue fixed in the typescript-json-schema tool? Or is this project deprecated and the other tool is the way to go anyway? I'm confused :) I tried to track down the problem myself but only found out that the magic most likely must be added here: https://github.com/YousefED/typescript-json-schema/blob/master/typescript-json-schema.ts#L773 |
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
The tool generates the following schema for type Test
I would expect the type of dummy be string instead of object.
Is this a bug ?
The text was updated successfully, but these errors were encountered: