swagger-api / swagger-api/swagger-ui

Expand all Models at once

Open
#6,494 7 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cat: rendering cat: style & presentation type: feature
Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

Content & configuration

Swagger-UI configuration options:

   SwaggerUI({
     spec,
     domNode: swaggerRef.current,
     defaultModelsExpandDepth: 10,
     defaultModelExpandDepth: 10,
     docExpansion: 'list',
     plugins: swaggerPlugins,
     showExtensions: true,
   });
Is your feature request related to a problem?

Users have to expand each schema under the "Model" section individually.

Describe the solution you'd like

Having an "Expand All" button to expand all schemas by default.

Describe alternatives you've considered

The defaultModelsExpandDepth seems to only work at the top level to expand the models, and doesn't seem to have any effect on expanding the individual models itself. The only significant change I see is when I set it to 0 the Models section is collapsed, and -1 hides it.

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 at the SwaggerUI configuration entry point and review how defaultModelsExpandDepth, defaultModelExpandDepth, and docExpansion affect the Models section. Trace the model rendering behavior to determine where an Expand All control or equivalent default behavior belongs. Done means users can expand all schemas together while the existing depth and visibility options continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 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.