rapi-doc / RapiDoc

RapiDoc -WebComponent for OpenAPI Spec
https://rapidocweb.com
MIT License
1.71k stars 285 forks source link

infinite loop when using show-curl-before-try #1045

Closed XaaXaaX closed 1 week ago

XaaXaaX commented 1 month ago

When using show-curl-before-try with big openapi files an infinite loop seems to hang out the rendering

mrin9 commented 1 month ago

is it possible to get a sample spec for us to recreate the issue at our end ?

XaaXaaX commented 1 month ago

Hello @mrin9 One of the users of eventcatalog reached out to us about the missing functionality for large specs. By removing that parameter show-curl-before-try, it seems to be working.

Let me give some more context i render the rapidoc in astro

---
.......
---
<rapi-doc
        spec-url={buildUrl(pathToSpec, true)}
        render-style="read"
        show-header="false"
        allow-authentication="true"
        allow-try="true"
        default-schema-tab="schema"
        show-curl-before-try="true"
        use-path-in-nav-bar="true"
        show-method-in-nav-bar="as-colored-block"
        theme="light"
        schema-style="table"
        class="relative top-0"
        style={{ height: '100vh', width: '100%', zIndex: 100 }}
        regular-font="ui-sans-serif, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji"
        bg-color="#ffffff"
        primary-color="#6b21a8"
        nav-bg-color="#fff"
        nav-text-color=""
        nav-hover-bg-color="#fff"
        nav-hover-text-color="#6b21a8"
        nav-accent-color=""
      />
mrin9 commented 1 month ago

I will check with the show-curl-before-try related code if there is any infinite looping possibility. It could be that the endpoint payloads may be too complex/large for it to generate all the curl syntaxes in a large spec.

can you try render-style="focused" and update me if that worked. This will provide if its a generic problem or issues with certain paths .

For large specs we recommend focused render-style as it displays only one path at a time.

XaaXaaX commented 1 month ago

Thanks @mrin9 i see the focuse and show-curl-before-try true works great with a dummy spec i ll reach the user to see if can try that and see if it works

but a problem with focused is for mobile users its not as desired for mobile user specs