Redocly/redoc

Type: Array and nullable: true does not render nullable

Open

#1155 opened on Jan 9, 2020

View on GitHub
 (1 comment) (1 reaction) (0 assignees)TypeScript (21,877 stars) (2,272 forks)batch import
Type: Bughelp wanted

Description

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
    }
  ]
}

grafik

Contributor guide