Add option to automatically expand schemas in SchemaDefinition to a certain level
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 25.9k
- Forks
- 2.4k
- Avg merge
- 13h 10m
- Merged PRs (30d)
- 4
Description
I use <SchemaDefinition> to render my schemas. All my schemas are enveloped so that when the page is loaded, unfortunately nothing useful is shown, and it is not possible to use the browser's Find-In-Page to search for useful properties. All the interesting stuff is "one level down".
I currently work around this by executing the following in the Redoc.init callback:
var els = document.querySelectorAll('td button');
for (el of els) {
el.click();
}
// Needed because expansion shifts the browser view
setTimeout(function () { window.location.hash = window.location.hash; })
This is, of course, just a hack and not in any way optimal.
It would be nice if ReDoc supported automatically expanding SchemaDefinition nodes to a certain level.
Note that #1693 would solve this fairly elegantly.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the SchemaDefinition component and its expansion controls, then compare the requested behavior with the approach mentioned in #1693. Done means ReDoc exposes a configurable expansion depth so enveloped schemas show useful nested properties on initial load without the DOM-click workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- documentation, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100