Redocly / Redocly/redoc

Problem with Array of Array

Open
#235 8 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I think that array of array are not handled correctly. The wrapping array is ignored while drawing the schema, while the sample is rendered correctly.

Here is a yaml example with two cases:

      responses:
        '200':
          description: array of array at root level
          schema:
            type: array
            items:
                type: array
                items:
                    type: object
                    properties:
                        name:
                            type: string
                        age:
                            type: integer
        '201':
          description: object of array of array
          schema:
            type: object
            properties:
                myArray: 
                    type: array
                    items:
                        type: array
                        items:
                            type: string

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 with the two YAML response schemas and compare the rendered schemas with their samples, covering both root-level and nested arrays. Trace the schema-rendering path and its existing tests, then add regression coverage for these cases. Done means both array wrappers appear in the rendered API documentation.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.