swagger-uiとredocをローカルで手早く動かす方法
Swagger, OpenAPIのドキュメント表示で一番使われてるやつ1 を手軽に手元で動かしたい時
TL;DR
# docker-compose.yml取ってくる
wget -O docker-compose.yml https://git.io/fjEfu
# 起動
docker-compose up -d
# swagger-ui開く
open http://localhost:8080
# redoc開く
open http://localhost:8081
手元にあるopenapi.json
を読み込ませたい時
# サンプルのopenapi.jsonをDLする
wget https://generator3.swagger.io/openapi.json
docker-compose.yml
と同じディレクトリにopenapi.json
がある場合、こんな風に編集すればOK
environment:
-- SPEC_URL: https://generator3.swagger.io/openapi.json
++ SPEC_URL: /openapi.json
++ volumes:
++ - ./openapi.json:/usr/share/nginx/html/openapi.json
- nginxのデフォルトの公開ディレクトリ
/usr/share/nginx/html
にopenapi.jsonがマウントされるようにしただけ
Author And Source
この問題について(swagger-uiとredocをローカルで手早く動かす方法), 我々は、より多くの情報をここで見つけました https://qiita.com/sakymark/items/1f2b774456113bc1ca07著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .