Share Swagger UI docs
Reviewing an OpenAPI change as a YAML diff is a way of not reviewing it. The parts most likely to be wrong — the description, the example payload, whether the error responses are complete — are the parts a diff renders worst.
Rendered in Swagger UI, the same change takes ninety seconds to review properly. The friction is that rendering it means serving it.
Publish it
Assemble a static build and upload the directory:
mkdir -p swagger-build
cp -r node_modules/swagger-ui-dist/* swagger-build/
cp openapi.yaml swagger-build/
# point the initializer at the local spec
sed -i.bak 's|https://petstore.swagger.io/v2/swagger.json|openapi.yaml|' \
swagger-build/swagger-initializer.js
Drag swagger-build/ into the app:
index.html becomes the report body, and the JS, CSS and the spec file
upload as assets with their references rewritten to the uploaded copies.
That rewrite is the part that matters — a Swagger UI page whose spec URL
still points at a localhost server renders an error, not documentation.
Scripts run inside a sandboxed iframe, so navigation and schema expansion work at the link.