Open robaca opened 10 months ago
The following example still in one case generates const instead of enum:
const
enum
type A = B | C interface B { myProp?: false } interface C { myProp: true }
When generating the schema like this:
typescript-json-schema --constAsEnum --strictNullChecks test.ts A
The outcome is:
{ "$schema": "http://json-schema.org/draft-07/schema#", "anyOf": [ { "$ref": "#/definitions/B" }, { "$ref": "#/definitions/C" } ], "definitions": { "B": { "properties": { "myProp": { "const": false, "type": "boolean" } }, "type": "object" }, "C": { "properties": { "myProp": { "enum": [ true ], "type": "boolean" } }, "type": "object" } } }
@domoritz do you still maintain this package? Any thoughts about this problem?
I don't use it anymore but merge PRs and make releases. I don't have time to triage or fix issues.
The following example still in one case generates
const
instead ofenum
:When generating the schema like this:
The outcome is: