Skip to content
Snippets Groups Projects
Verified Commit 84533602 authored by Karel van Klink's avatar Karel van Klink :smiley_cat:
Browse files

remove openapi spec from docs as we only have a single endpoint

parent bfd74342
No related branches found
No related tags found
No related merge requests found
......@@ -5,12 +5,8 @@ set -o nounset
pip install -r requirements.txt
pip install -e .
export SETTINGS_FILENAME=./config.json.example
python docs/dump-openapi-spec.py
rm -r ./docs/build/*
vale --config=docs/vale/.vale.ini sync
vale --config=docs/vale/.vale.ini docs/source/*.rst lso/*.py
sphinx-build -b html docs/source docs/build
unset SETTINGS_FILENAME
sphinx-build -b html docs/source docs/build
import json
import os
from fastapi.testclient import TestClient
import lso
config_filename = os.path.join(os.path.dirname(__file__), "..", "config.json.example")
output_filename = os.path.join(os.path.dirname(__file__), "source", "_static", "openapi.json")
os.environ["SETTINGS_FILENAME"] = config_filename
app = lso.create_app()
client = TestClient(app)
rsp = client.get("/openapi.json")
openapi_doc = json.dumps(rsp.json(), indent=2)
with open(output_filename, "w") as f:
f.write(openapi_doc)
print(f"wrote {output_filename}")
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta
name="description"
content="SwaggerUI"
/>
<title>SwaggerUI</title>
<link rel="stylesheet" href="https://unpkg.com/swagger-ui-dist@4.5.0/swagger-ui.css" />
</head>
<body>
<div id="swagger-ui"></div>
<script src="https://unpkg.com/swagger-ui-dist@4.5.0/swagger-ui-bundle.js" crossorigin></script>
<script>
window.onload = () => {
window.ui = SwaggerUIBundle({
url: 'openapi.json',
dom_id: '#swagger-ui',
});
};
</script>
</body>
</html>
......@@ -9,6 +9,3 @@ Documentation for LSO (Lightweight Service Orchestrator).
quickstart
modules
`Swagger API Docs <_static/openapi.html>`_
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment