Skip to content

Don't automatically reload OpenAPI file #2808

@not-my-profile

Description

@not-my-profile

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"
/>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions