Giter Club home page Giter Club logo

yapi-cli's People

Contributors

gaoxiaomumu avatar hellosean1025 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yapi-cli's Issues

使用yapi-cli update遇到的问题

hi:
在使用yapi-cli update遇到两个问题.
1.yapi-cli update执行成功之后状态退出码为1,导致从dockerfile制作docker镜像失败
image
2.yapi-cli update调用的npm install写死的是淘宝的npm源,我想在使用私有的registry,这两个问题能否帮忙解决?

yapi import 不支持node14

(node:67551) Warning: Accessing non-existent property 'cat' of module exports inside circular dependency
(Use node --trace-warnings ... to show where the warning was created)
(node:67551) Warning: Accessing non-existent property 'cd' of module exports inside circular dependency
(node:67551) Warning: Accessing non-existent property 'chmod' of module exports inside circular dependency
(node:67551) Warning: Accessing non-existent property 'cp' of module exports inside circular dependency
(node:67551) Warning: Accessing non-existent property 'dirs' of module exports inside circular dependency
(node:67551) Warning: Accessing non-existent property 'pushd' of module exports inside circular dependency
(node:67551) Warning: Accessing non-existent property 'popd' of module exports inside circular dependency

切换为12正常

最新版并不支持指定端口号

问题:执行yapi server --port 9290依然提示9090端口。
yapi-cli版本:1.5.0
问题版本代码:
src/commands/server.js文件中
` app.get('/api/base', async function (req, res) {

  let versions = await utils.getVersions();
  res.send({
    versions,
    root: path.resolve(process.cwd(), 'my-yapi')
  })

})
app.use(express.static(path.resolve(__dirname, './server')))
app.listen(9090)
console.log('在浏览器打开 http://0.0.0.0:9090 访问。非本地服务器,请将 0.0.0.0 替换成指定的域名或

ip ');`
写死了端口。

自动化导入go swag 2.0 ,返回data 出现混乱

go swag 2.0 语法解析有问题。

形如如下语法格式,解析不出来。升级swag client 后,手动拖拽正常。自动导入异常

            "responses": {
                "200": {
                    "description": "OK",
                    "schema": {
                        "allOf": [
                            {
                                "$ref": "#/definitions/models.RtCode"
                            },
                            {
                                "type": "object",
                                "properties": {
                                    "data": {
                                        "$ref": "#/definitions/models.RtGoodsBaseInfo"
                                    }
                                }
                            }
                        ]
                    }
                }
            }
        }

yapi import从多个swagger源导入

如题
当用yapi import导入swagger生成的接口文档时,只能导入到一个项目,希望能同时有多个swagger.json脚本导入多个项目

在配置数据库帐号和密码时显示config.db.user undefined

在配置数据库密码时,显示如下错误:

yapi-cli/src/commands/server.js:38
config.db.user = config.dbUser;
^
TypeError: Cannot set property 'user' of undefined

把38行的代码修改为:
data.db.user = config.dbUser;
data.db.pass = config.dbPass;
希望修复。

增加初始化可填认证数据库

对于 MongoDBauthSourcecli 工具没有在初始化界面提供该设置,这里我已经在本地修改过,测试OK的了,稍后奉上PR。

yapi import path不支持 {} ()

解析出来的path有 "/oss/{id+}" 和 "/(zuul|vega)/wechat/getToken",不支持导入

{
    "openapi": "3.0.0",
    "info": {
        "description": "swagger-ui for midway api",
        "version": "1.0.0",
        "title": "midway-swagger",
        "termsOfService": "",
        "contact": {
            "name": "API Support",
            "url": "http://www.example.com/support",
            "email": "[email protected]"
        },
        "license": {
            "name": "Apache 2.0",
            "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
        }
    },
    "tags": [
        {
            "name": "配置",
            "description": "配置相关模块"
        },
        {
            "name": "eureka",
            "description": "eureka相关模块"
        },
        {
            "name": "default",
            "description": "default"
        },
        {
            "name": "oss",
            "description": "oss相关"
        },
        {
            "name": "微信",
            "description": "微信相关"
        }
    ],
    "paths": {
        "/zuul/config/": {
            "get": {
                "tags": [
                    "配置"
                ],
                "summary": "获取配置",
                "description": "只有apollo白名单内的配置才能获取",
                "parameters": [
                    {
                        "in": "query",
                        "name": "path",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": ""
                    }
                }
            }
        },
        "/zuul/config/getSXBSrc": {
            "get": {
                "tags": [
                    "配置"
                ],
                "parameters": [],
                "responses": {
                    "200": {
                        "description": ""
                    }
                }
            }
        },
        "/zuul/config/getEagleEyeSrc": {
            "get": {
                "tags": [
                    "配置"
                ],
                "parameters": [],
                "responses": {
                    "200": {
                        "description": ""
                    }
                }
            }
        },
        "/zuul/config/getUserGuideSrc": {
            "get": {
                "tags": [
                    "配置"
                ],
                "parameters": [],
                "responses": {
                    "200": {
                        "description": ""
                    }
                }
            }
        },
        "/zuul/config/frontMonitor": {
            "get": {
                "tags": [
                    "配置"
                ],
                "parameters": [],
                "responses": {
                    "200": {
                        "description": ""
                    }
                }
            }
        },
        "/info": {
            "get": {
                "tags": [
                    "eureka"
                ],
                "summary": "获取应用信息",
                "description": "获取应用信息",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": ""
                    }
                }
            }
        },
        "/health": {
            "get": {
                "tags": [
                    "eureka"
                ],
                "summary": "健康检查",
                "description": "用于k8s获取应用健康状态",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": ""
                    }
                }
            }
        },
        "/": {
            "get": {
                "tags": [
                    "default"
                ],
                "parameters": [],
                "responses": {
                    "200": {
                        "description": ""
                    }
                }
            }
        },
        "/check": {
            "get": {
                "tags": [
                    "default"
                ],
                "parameters": [],
                "responses": {
                    "200": {
                        "description": ""
                    }
                }
            }
        },
        "/getError": {
            "get": {
                "tags": [
                    "default"
                ],
                "parameters": [],
                "responses": {
                    "200": {
                        "description": ""
                    }
                }
            }
        },
        "/oss/{id+}": {
            "get": {
                "tags": [
                    "oss"
                ],
                "summary": "oss资源重定向",
                "description": "oss资源重定向",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": ""
                    }
                }
            }
        },
        "/(zuul|vega)/wechat/getSignature": {
            "get": {
                "tags": [
                    "微信"
                ],
                "summary": "微信jssdk签名校验",
                "description": "微信jssdk签名校验",
                "parameters": [
                    {
                        "in": "header",
                        "name": "referer",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": ""
                    }
                }
            }
        },
        "/(zuul|vega)/wechat/getToken": {
            "get": {
                "tags": [
                    "微信"
                ],
                "summary": "获取token",
                "description": "获取token",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": ""
                    }
                }
            }
        },
        "/(zuul|vega)/wechat/router": {
            "all": {
                "tags": [
                    "微信"
                ],
                "parameters": [],
                "responses": {
                    "200": {
                        "description": ""
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {}
    }
}

why

依赖库安装完成,正在初始化数据库mongodb...

[email protected] install-server /Users/swmonk/test_yapi/my-yapi/vendors
node server/install.js

Error: (node:21384) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.

可视化部署时,初始化数据库mongodb失败

  • node : v10.16.3
  • mongodb : v4.2.3
    错误信息:

[email protected] install-server /root/yapi/vendors > node server/install.js
Error: (node:27668) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor

应该是新版本mongodb 连接 useUnifiedTopology 参数需要设置。
因为不想降级mongodb,所以用命令行部署模式,修改了utils/db.js 22行为

 let options = {useNewUrlParser: true, useCreateIndex: true,useUnifiedTopology:true};

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.