Redoc: Expand all on Response Schema

Created on 23 Feb 2017  路  9Comments  路  Source: Redocly/redoc

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?

feature

Most helpful comment

is there any update on this? I would really appreciate this feature too.

All 9 comments

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();
    }
  })
Was this page helpful?
0 / 5 - 0 ratings

Related issues

RomanHotsiy picture RomanHotsiy  路  3Comments

dvh picture dvh  路  3Comments

skllcrn picture skllcrn  路  3Comments

jaroslawr picture jaroslawr  路  3Comments

gavinkalika picture gavinkalika  路  3Comments