-
Notifications
You must be signed in to change notification settings - Fork 40
希望把reqBody和response的类型单独提取出来 #286
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
Comments
能根据配置生成更精简的函数代码可以做到,只是没有明确提及,但是你要这样做已经可以支持,只是更推荐自己写一个和业务相关的adapter去实现 |
根据配置生成更精简的函数代码可以看下customTemplates参数,去源码里面看一下如何使用,应该可以满足你的需求 |
request,body的type没有生成,是没有做额外的处理,如果本身后端就是抽象的公共类型ref,生成出来就是具名可复用的,你跑一下项目测试用例就可以看到,但是你本身就是匿名的字段,我可以提供一个参数去转换为具名 |
有什么参数可以将匿名字段转换为具名字段 |
我在测试用例里看到了,感谢! |
目前没有,需要开发,有兴趣来pr吗? |
不客气 |
那得我有时间完全看懂这个项目才行,最近一段时间可能没空。 |
这个功能已经开发完了,https://github.com/openapi-ui/openapi-ts-request/releases/tag/v1.5.0 |
Uh oh!
There was an error while loading. Please reload this page.
这是目前生成的代码,期望生成的代码如下:
这样做的目的是接口类型能更好地被其它模块引用
如果能通过配置生成更精简的代码就更好了,如下:
假如request.post方法在request.js里已经定义好了
The text was updated successfully, but these errors were encountered: