Redocly / Redocly/redoc

Multiple parallel anyOf keywords are not visible, only the first one is

Open
#1,114 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Expected behaviour:
Multiple parallel anyOf keywords will result in multiple anyOf UI elements and all parameters are visible:
image

Actual behaviour:
Only a single anyOf element is displayed and parameters of the second keyword are not visible at all:
image

Test schema:

{
  "openapi": "3.0.0",
  "info": {
    "title": "Bug API",
    "version": "1.0.0"
  },
  "paths": {
    "/": {
      "post": {
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "title": "Schema",
                "allOf": [
                  {
                    "properties": {
                      "allOfParam1": {
                        "type": "string"
                      }
                    }
                  },
                  {
                    "anyOf": [
                      {
                        "required": [
                          "anyOf1Param1"
                        ],
                        "title": "anyOf1Param1",
                        "properties": {
                          "anyOf1Param1": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "required": [
                          "anyOf1Param2"
                        ],
                        "title": "anyOf1Param2",
                        "properties": {
                          "anyOf1Param2": {
                            "type": "string"
                          }
                        }
                      }
                    ]
                  },
                  {
                    "anyOf": [
                      {
                        "required": [
                          "anyOf2Param1"
                        ],
                        "title": "anyOf2Param1",
                        "properties": {
                          "anyOf2Param1": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "required": [
                          "anyOf2Param2"
                        ],
                        "title": "anyOf2Param2",
                        "properties": {
                          "anyOf2Param2": {
                            "type": "string"
                          }
                        }
                      }
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {

        }
      }
    }
  }
}

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.

Research direction

Reproduce the issue in the Redoc UI using the supplied OpenAPI 3.0 schema, focusing on the nested parallel anyOf branches. Done means both anyOf UI elements are visible and all parameters from their branches can be accessed; the issue names no source file or test to start from.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.