Redocly/redoc
Type: Array and nullable: true does not render nullable
Aperta
#1155 aperta il 9 gen 2020
Type: Bughelp wanted
Metriche repository
- Star
- (21.877 stelle)
- Metriche merge PR
- (Metriche PR in attesa)
Descrizione
I have a response which either returns an array or null. I specify the return json schema with:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "array",
"uniqueItems": true,
"items": {
....
}
"nullable": true
}
But redoc does not render this like for other types e.g. integers.
I currently use the following workaround:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"oneOf": [
{
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "../shared/id.json#"
}
},
{
"type": "any"
"nullable":true
}
]
}
