Redocly / Redocly/redoc

Infer nullable from schema

Open
#1,503 1 comment 0 reactions 1 assignee View on GitHub

@AntonKozachuk is already working on this.

Since Jan 28, 2021.

Type: Enhancement
Dominant language
TypeScript
Stars
25.9k
Forks
2.4k
Avg merge
13h 10m
Merged PRs (30d)
4

Description

OAS 3.1 is removing nullable from the specification for the JSON schemas in favor of using the JSON-schema way which is

{ "type": ["string", "null"] }
{ "oneOf": [ { "type": "string" }, { "type": "null" } ] }

Redoc right now sort of supports the second option (won't show the Nullable label though) and doesn't have any support for array type.

The expected result would be to treat both options exactly the same way as

{
  "type": "string",
  "nullable": true
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.