ymfe / yapi-cli Goto Github PK
View Code? Open in Web Editor NEWYApi可视化接口管理平台部署工具
YApi可视化接口管理平台部署工具
(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 语法解析有问题。
形如如下语法格式,解析不出来。升级swag client 后,手动拖拽正常。自动导入异常
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/models.RtCode"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/models.RtGoodsBaseInfo"
}
}
}
]
}
}
}
}
在import.js#L32增加解析yaml 格式文件
如题
当用yapi import导入swagger生成的接口文档时,只能导入到一个项目,希望能同时有多个swagger.json脚本导入多个项目
在配置数据库密码时,显示如下错误:
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;
希望修复。
对于 MongoDB
的 authSource
,cli
工具没有在初始化界面提供该设置,这里我已经在本地修改过,测试OK的了,稍后奉上PR。
解析出来的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": {}
}
}
依赖库安装完成,正在初始化数据库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.
[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};
https://registry.npm.taobao.org 因为证书过期,无法下载
希望能够解决
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.