原文: https://j2hongming.github.io/2021/08/06/view-open-api-in-local/
open API类似原始资料, 可以使用ReDoc或是Swagger UI其中之一呈现
若有使用vs code的话可以直接安装扩充功能: OpenAPI (Swagger) Editor
若想要放在内部机器上可以使用docker
git clone git@github.com:j2hongming/open_api.git
docker-compose.yaml内容如下
version: '3'services: redoc: image: redocly/redoc ports: - 8888:80 volumes: - ./api.yaml:/usr/share/nginx/html/api.yaml environment: - SPEC_URL=/api.yaml swagger: image: swaggerapi/swagger-ui ports: - 8080:8080 volumes: - ./api.yaml:/api.yaml environment: - SWAGGER_JSON=/api.yaml