yapi-to-typescript icon indicating copy to clipboard operation
yapi-to-typescript copied to clipboard

根据 YApi 或 Swagger 的接口定义生成 TypeScript 或 JavaScript 的接口类型及其请求函数代码。

Results 10 yapi-to-typescript issues
Sort by recently updated
recently updated
newest added

高版本的yapi支持title和desc,希望在请求响应的类型注释中增加每一项的title。 如JsonSchema: ``` requestDataJsonSchema: { title: '测试注册表单', description: 'A simple form example.', type: 'object', required: ['firstName', 'lastName'], 'ui:order': ['lastName', 'firstName', '*', 'password'], properties: { firstName: { type: 'string', title: 'First...

运行npx ytt -c ytt.config.ts 时报错,下面是控制台输出和依赖版本 ```shell zhaolinxiao@zlx site % npx ytt -c ytt.config.ts ✔ 找到配置文件: /Users/zhaolinxiao/workspace/site/ytt.config.ts 11:37:52 ✔ 获取数据并生成代码完毕 11:37:55 jsxBracketSameLine is deprecated. ERROR Error: Debug Failure. 11:37:55 at /Users/zhaolinxiao/workspace/site/node_modules/yapi-to-typescript/node_modules/prettier/parser-typescript.js:22:831968...

我看YTT配置中会把Content-Type的请求头过滤掉, 不知道是出于什么考虑要这么做。 项目中肯定会有json或者formData这种场景,如果YTT做了这层的过滤, 那再统一的请求函数中就拿不到yapi中配置的该信息,那内部的请求应该怎么添加不同的请求头呢?

执行npx ytt报错: √ 找到配置文件: F:\query\ytt.config.ts 10:35:22 ERROR Cannot delete property '0' of [object String] 10:35:24 at node_modules\yapi-to-typescript\lib\cjs\utils.js:201:38 at node_modules\lodash\lodash.js:4967:15 at baseForOwn (node_modules\lodash\lodash.js:3032:24) at forOwn (node_modules\lodash\lodash.js:13082:24) at node_modules\yapi-to-typescript\lib\cjs\utils.js:199:25 at traverseJsonSchema (node_modules\yapi-to-typescript\lib\cjs\utils.js:114:3)

排查发现是haoma\lib\compile.js 37行,提取的公共路径会带上`\\`,导致路径出错 `'D:/yapi-to-typescript/src\\'`

使用 swagger 模式生成 mockUrl 是错误的,会变成本地服务的地址,这个是否可以给 project 加个参数 getMockUrl?

用yapi-to-typescript生成ts文件时,文件本身会加上 ` // @ts-ignore type FileData = File; ` 但是如果生成了多个ts文件,可能会因为冲突而报错 ` Module './api/147' has already exported a member named 'FileData'. Consider explicitly re-exporting to resolve the ambiguity.` 这种情况如何处理?

请登录... [请求地址: http://xxx.xxx.com/yapi/api/plugin/export] [请求参数: type=json&status=all&isWiki=false&token=06f3689ce99eb727475eacce4162a6dc91948b6cf88c2581d7aa4c0fda5acb60]

由于依赖的原因,生成的mockUrl在打包时会被保留,导致yapi路径被暴露,而yapi已经是不怎么维护的项目了,于是被漏洞检测公司认为是安全漏洞。 希望能增加配置项隐藏mockUrl等打包后会暴露地址的配置。