我关注了 swagger-ui installation我不能得到这份工作。问题是无法访问 java-script 文件。名称似乎是错误的 - index.html 期望 SwaggerUiStandalonePreset.js
并在 /dist 目录只有 swagger-ui-standalone-preset.js
.
我以为这是个问题,但是disclaimer on github解释:
<!-- don't be alarmed, these don't match what's in dist, because webpack-dev-server serves them in memory. -->
<script src="/dist/SwaggerUIBundle.js"> </script>
现在做什么?
最佳答案
这种情况似乎是新版 swagger-ui 的一个 bug。
如果你想让这个应用程序运行,只需移动 /dist 目录到您的 http 服务器的父目录并重命名以下文件:
关于Swagger-ui 无法访问 JS 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42926158/