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

Update instructions to preview Swagger definitions #1331

Merged
merged 3 commits into from
Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,9 @@ For building the swagger definitions, create a python3 virtualenv and activate i
and finally `python ./scripts/dump-swagger.py` to generate it to `./scripts/swagger/api-docs.json`. To make use of the generated file,
there are a number of options:

* It can be uploaded from your filesystem to an online editor/viewer such as [on the swagger website](http://editor.swagger.io/).
* You can run a local HTTP server by running `./scripts/swagger-http-server.py`, and then view the documentation via an
online viewer; for example, at <http://petstore.swagger.io/?url=http://localhost:8000/api-docs.json>.
* You can host the swagger UI yourself. See <https://github.com/swagger-api/swagger-ui#how-to-run> for advice on how to
do so.
* You can open `./scripts/swagger-preview.html`in your browser, and then open the file by clicking on `Local JSON File`.
richvdh marked this conversation as resolved.
Show resolved Hide resolved
* You can run a local HTTP server by running `./scripts/swagger-http-server.py`, and then view the documentation by
opening `./scripts/swagger-preview.html` in your browser.

## Issue tracking

Expand Down
1 change: 1 addition & 0 deletions changelogs/internal/newsfragments/1331.clarification
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update instructions to preview Swagger definitions.
13 changes: 13 additions & 0 deletions scripts/swagger-preview.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html>

<head>
<meta charset="utf-8">
<script type="module" src="https://unpkg.com/rapidoc/dist/rapidoc-min.js"></script>
</head>

<body>
<rapi-doc spec-url="http://localhost:8000/api-docs.json"> </rapi-doc>
</body>

</html>