elements icon indicating copy to clipboard operation
elements copied to clipboard

Don't automatically reload OpenAPI file

Open not-my-profile opened this issue 6 months ago • 0 comments

I'm using Stoplight Elements via the huma framework. So when I'm starting my server I can view the API documentation under /docs. Annoyingly Elements apparently automatically re-fetches the apiDescriptionUrl every couple minutes meaning that when I stop the server then shortly after the documentation disappears and gets replaced with an error page:

Screenshot showing Document could not be loaded

I'm using Elements 9.0.0 via:

<link href="https://unpkg.com/@stoplight/[email protected]/styles.min.css" rel="stylesheet" />
<script src="https://unpkg.com/@stoplight/[email protected]/web-components.min.js" integrity="sha256-Tqvw1qE2abI+G6dPQBc5zbeHqfVwGoamETU3/TSpUw4="
        crossorigin="anonymous"></script>

<elements-api
  apiDescriptionUrl="` + openAPIPath + `.yaml"
  router="hash"
  layout="sidebar"
  tryItCredentialsPolicy="same-origin"
/>

not-my-profile avatar Jun 28 '25 09:06 not-my-profile