Open
Description
Hello,
I think I discovered a regression defect when upgrading from 1.5.0 to 2.3.0.
Given following minimal example:
export interface Example {
property: string | false;
}
I get:
{
"$ref": "#/definitions/Example",
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"Example": {
"additionalProperties": false,
"properties": {
"property": {
"enum": [
false
],
"type": "boolean"
}
},
"required": [
"property"
],
"type": "object"
}
}
}
Where I would expect:
{
"$ref": "#/definitions/Example",
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"Example": {
"additionalProperties": false,
"properties": {
"property": {
"anyOf": [
{
"type": "string"
},
{
"type": "boolean",
"const": false
}
],
}
},
"required": [
"property"
],
"type": "object"
}
}
}
Interestingly, unions like number | false
and string[] | false
work fine.
Metadata
Metadata
Assignees
Labels
No labels