結論
下記のようにHTMLとAPI仕様yamlを用意し、ローカルサーバーを立ち上げればよい。
ローカルサーバーを立ち上げるのがポイントで、そうしないと、エラーになる。
理由はわからない。(ご存じの方教えてください...)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Redoc Sample</title>
</head>
<body>
<redoc spec-url='./swagger.yaml'></redoc>
<script src="https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js"> </script>
</body>
</html>
この中身は下記取得し、書き換えてください。
https://petstore.swagger.io/v2/swagger.yaml
>python -m http.server -8000
## ブラウザでlocalhost:8000 にアクセスできるようになる
経緯とか
API仕様書をエクセルで管理すると更新情報の記載だったり、差分の確認がそもそも困難だったりといろんなデメリットがあります。
UIがそこそこなのはメリットですが。
とりあえずお試しで使ってみてます。
参考記事
https://hirabay.net/?p=108
https://techblog.asia-quest.jp/202207/api-documentation-has-been-redesigned-with-redoc
https://qiita.com/tuken24/items/fc002cd373bbcc9b726c
pythonでローカルサーバー
https://qiita.com/okhrn/items/4d3c74563154f191ba16
ローカルのyamlが表示できない問題の話題(ローカルサーバーで解決)
https://github.com/Redocly/redoc/issues/1222
https://stackoverflow.com/questions/75300068/redoc-cannot-display-a-local-openapi-definition-file
公式の説明 ローカルサーバーが必要な記述、、、ある?
https://redocly.com/docs/redoc/deployment/html/