当我在在线工具
错误:找不到模块./middleware/swagger.router"
解决方案短期修复:您可以让它运行,直到 oas3-tools 和 Smartbear(对于此服务器生成器)的维护者修复它们各自的部分.
问题 A:oas3-tools 构建脚本没有将中间件"复制到dist"目录.
要解决此问题:
问题 B:
下一个问题是 swagger 文档路径上的拼写错误.
要解决此问题:
可能的额外问题:
您可能需要手动转换 .ts 文件.如果您也遇到此问题(即 error TS6053: File 'dist/middleware/.ts' not found. Found 1 error)
,请参阅下面的@Alex 评论- 此处发布了 Swagger 编辑器错误:github/swagger-api/swagger-editor/issues/2086
- Oas3-tools 错误发布在这里:github/漏洞猎人/oas3-tools/issues/17
When I generate a nodejs-server with swagger 3.0.1 in the online tool editor.swagger.io/ and try to npm start the project I always get the following error:
Error: Cannot find module './middleware/swagger.router'
解决方案Short-term fix: you can get it to run until the maintainer of oas3-tools and Smartbear (for this server generator) fixes their respective parts.
PROBLEM A: oas3-tools build script isn't copying the 'middleware' over to the 'dist' directory.
To fix this:
PROBLEM B:
The next issue is a typo on the path to the swagger document is incorrect.
To fix this:
POSSIBLE EXTRA PROBLEM:
You may need to manually transpile your .ts files. Please see @Alex's comment below if you also run into this (i.e. error TS6053: File 'dist/middleware/.ts' not found. Found 1 error)
- Swagger Editor bug posted here: github/swagger-api/swagger-editor/issues/2086
- Oas3-tools bug posted here: github/bug-hunters/oas3-tools/issues/17
更多推荐
Swagger 3.0.1 服务器生成器
发布评论