Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Stoplight Elements to render OpenAPI docs #693

Merged
merged 8 commits into from
Jun 5, 2024

Conversation

carlhoerberg
Copy link
Member

WHAT is this pull request doing?

Instead of compiling static html files from openapi.yaml using redoc the docs are now rendered in the browser using https://github.com/stoplightio/elements

HOW can this pull request be tested?

Compile and then browse to http://localhost:15672/docs/

@carlhoerberg
Copy link
Member Author

Required (or a variant of it) by #692. Installing nodejs with a recent version in all distros (ubuntu 20.04, debian 11) is a hassle, and just required for building the static html.

Comment on lines 7 to 8
<script src="https://unpkg.com/@stoplight/elements/web-components.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@stoplight/elements/styles.min.css">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is probably a good idea lock these to a certain version so they does not break on us unexpectedly. Using Subresource Integrity (SRI) we can also ensure that it is the correct version served from the CDN: https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or download locally?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@snichme snichme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Copy link
Member

@viktorerlingsson viktorerlingsson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with @dentarg about locking versions, otherwise looks good! 👍

@carlhoerberg carlhoerberg merged commit 418400e into main Jun 5, 2024
10 of 21 checks passed
@carlhoerberg carlhoerberg deleted the elements-openapi-docs branch June 5, 2024 19:00
viktorerlingsson pushed a commit that referenced this pull request Sep 20, 2024
Instead of compiling static html files from openapi.yaml using redoc the docs are now rendered in the browser using https://github.com/stoplightio/elements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants