如何防止 Swagger 跟随 302 重定向?

How to prevent Swagger from following 302 Redirects?

所以我有一个 API in swagger 可以正常工作。但是,我想在 302 重定向后自动禁用它,因为我需要 302 的位置 header 上的查询参数。有什么办法可以在 Swagger / Open API 3 中做到这一点?

Swagger UI 和 Swagger 编辑器 always follow redirects。要查看 3xx 响应,请使用 curl 等非浏览器工具测试请求。您可以从 Swagger UI.

复制 curl 命令
curl https://httpbin.org/status/302 -i