在 Debian 系统上,“Swagger 在哪查看”通常取决于你指的是哪种场景。下面分情况说明:
如果是某个Web 服务 / API 项目使用了 Swagger(如 Spring Boot、FastAPI、Node.js 等):
一般在服务启动后通过浏览器访问:
http://<服务器IP>:<端口>/swagger-ui.html(Spring Boot 常见)http://<服务器IP>:<端口>/swagger-ui/http://<服务器IP>:<端口>/docs(FastAPI 默认)http://<服务器IP>:<端口>/api-docs示例:
http://localhost:8080/swagger-ui.html
ss -lntp | grep <端口>
# 或
systemctl status <服务名>
查看是否安装:
which swagger
swagger --version
如果是 swagger-cli:
npx swagger-cli validate swagger.yaml
Swagger 文件一般是:
swagger.yamlswagger.json可用以下方式查看:
cat swagger.yaml
或浏览器打开:
xdg-open swagger.yaml
本地启动 Swagger Editor:
docker run -p 8080:8080 swaggerapi/swagger-editor
然后访问:
http://localhost:8080
localhost 监听springdoc.swagger-ui.enabled=false)如果你能补充:
我可以给你更精确的查看方式。