Redocly / Redocly/redoc

Add option to automatically expand sub-items (e.g. vendor extension)

Open
#1,693 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I have the following discriminated schema:

image

When changing the discriminator value to a new value, payload (which in this case contains the interesting stuff) is collapsed. (If I expand it, it remembers it if I change back to the same discriminator value, but it's always collapsed when first viewing it.)

It would be very useful for me to be able to specify that certain schema properties, when they are visible, should automatically expand.

For example, a vendor extension x-autoExpand: true could be set on my schema's payload so that each time ReDoc renders nodes with this extension set to true, it expands the object. Other good/better solutions may exist for the same use-case.

Note that this would also solve #1692 fairly elegantly.

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

The issue does not name files, tests, or entry points; start by tracing the rendering behavior when a discriminator changes and the payload becomes visible. Done means a documented option, such as the proposed vendor extension or an agreed alternative, automatically expands matching visible schema properties without breaking remembered expansion state.

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
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.