Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

这个组件可以用在typescript的koa项目中吗? #93

Open
sxlvalue opened this issue Jun 28, 2020 · 5 comments
Open

这个组件可以用在typescript的koa项目中吗? #93

sxlvalue opened this issue Jun 28, 2020 · 5 comments

Comments

@sxlvalue
Copy link

这个组件可以用在typescript的koa项目中吗?我在我们的TS项目中尝试集成这个组件,最终在API列表中显示No operations defined in spec!。我们的TS项目最终编译出来的是一个webpack打包JS文件,会和这个有关系吗?

@oooonly
Copy link

oooonly commented Jul 3, 2020

同问,我也是ts下不显示定义的接口

@oooonly
Copy link

oooonly commented Jul 6, 2020

同问,我也是ts下不显示定义的接口

emitDecoratorMetadata我的关闭了这个选项就好了

@Cody2333
Copy link
Owner

Cody2333 commented Jul 7, 2020

可以在 typescript 使用,但是通过 webpack 打成 bundle 后可能会跑不起来的,因为运行时 mapDir 会遍历目录去加载路由

@Horaceluo
Copy link

可尝试将TypeScript的编译选项”target“设置为ES6

如果TypeScript的编译选项"target"设置为ES5的话,类并不是使用class来实现。类的方法是通过Object.prototype来定义的匿名函数,这种情况下,function.name这个属性的值是个空字符串。导致swagger key值与装饰器生成的key值不一致。最终文档无法显示出来。

@SankarRavichandran
Copy link

can't we use webpack then? Is there any alternate solutions available to use webpack & koa-swagger-decorator combinedly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants