I have a deeply nested response schema. Currently it's very cumbersome to see the full schema, I need to click on each nested object. ReDoc has "expand all" on example response, does it also support the same on the schema?
Hey @sixers,
at the moment ReDoc doesn't support this.
I've added feature badge to this issue. Most likely this feature will be shipped in a few weeks.
Hey, any update on this?
@sixers unfortunately no.
I'm quite busy with other things around ReDoc right now ("Try it out" feature).
I will try to get this done asap. If you don't see it during the next two weeks, ping me again. Thanks
Kind of a workaround, not a very good one tho
.collapser {
display: none !important;
}
.ellipsis {
display: none !important;
}
.collapsible {
display: block !important;
}
Maybe also provide the similar function as the examples on the right.
Including both "Expand All" and "Collapse All" for the schema, which will be quite useful for deep nested schemas.
I suppose it would be better to have an option which can be passed along expandResponses to define the level to which it should be expanded.
is there any update on this? I would really appreciate this feature too.
Possible workaround. Not sure if it has negative effect:
<body>
<redoc spec-url='openapi.yaml'></redoc>
<script src="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js"> </script>
<script>
setTimeout(function() {
var els = document.querySelectorAll('.collapsible .collapsed');
for(el of els) {
el.classList.remove('collapsed');
}
}, 100);
</script>
</body>
Would be great to see support for this!
In the meantime, here's my workaround, using the callback of Redoc.init to trigger a click on all td elements.
Redoc.init(
"spec.yaml",
{
// your props here
},
document.getElementById("redoc-container"),
function () {
var els = document.querySelectorAll('td');
for (el of els) {
el.click();
}
})
Most helpful comment
is there any update on this? I would really appreciate this feature too.