Redocly / Redocly/redoc

Schema depth should be configurable

Open
#2,685 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the problem to be solved
Depth of JSON request/response schema appears limited to 8, after which no more details are possible to get and instead Recursive is displayed. The sample view does have a configurable max depth; generatedSamplesMaxDepth, which is somewhat helpful but no documentation is provided in this view.

Describe the solution you'd like
An additional configuration option, e.g. generatedSchemaMaxDepth that would enable parity between the schema and sample view in terms of possible depth.

Describe alternatives you've considered

  • Change hard-coded defaults from 8 to something higher, like 10 or 12. It would likely suffice in my scenario but may have other side-effects, plus it's not consistent with how other max depths are controlled.
  • Control max depth in schema using the same property as controls sample depth. I think that would be misleading as the existing property has Samples in its name and should be limited to the samples view only.

Additional context
An example of such a deep (response) structure is here (The response to /v2alpha/data/model/concepts)

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

Start by locating the existing generatedSamplesMaxDepth configuration and the code that limits JSON request and response schema depth. Add an independent schema-depth option without changing the sample setting, and verify that deeper schemas no longer collapse to Recursive while the configured limit is respected.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.