登录
注册
开源
企业版
高校版
搜索
帮助中心
使用条款
关于我们
开源
企业版
高校版
私有云
模力方舟
登录
注册
代码拉取完成,页面将自动刷新
开源项目
>
开发工具
>
开发/调试
&&
WEB应用开发
>
WebUI组件/框架
&&
捐赠
捐赠前请先登录
取消
前往登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
Watch
不关注
关注所有动态
仅关注版本发行动态
关注但不提醒动态
788
Star
7K
Fork
1.4K
GVP
萧明
/
knife4j
代码
Issues
229
Pull Requests
7
Wiki
统计
流水线
服务
JavaDoc
质量分析
Jenkins for Gitee
腾讯云托管
腾讯云 Serverless
悬镜安全
阿里云 SAE
Codeblitz
SBOM
我知道了,不再自动展开
43
swagger models 中的枚举显示
已合并
igeekfan:dev
萧明:dev
igeekfan
创建于 2021-04-24 17:11
克隆/下载
HTTPS
SSH
复制
下载 Email Patch
下载 Diff 文件
您好!这边编辑器会自动把注释后面的空格去掉。 重要的是2095行的这段处理。 ``` else if(def.hasOwnProperty("enum")){ var refp = new SwaggerBootstrapUiParameter(); refp.pid = originalTreeTableModel.id; refp.readOnly = def.readOnly; refp.parentTypes.push(treeTableModel.name) refp.parentTypes.push(key) refp.name = pkey; refp.type =def.type; refp.example = def.example; description = "可用值:" + def["enum"].join(","); refp.description = KUtils.replaceMultipLineStr(description); //models添加所有属性 originalTreeTableModel.params.push(refp); } ``` 处理前  处理后  完整Json ``` { "openapi": "3.0.1", "info": { "title": "API V1", "version": "v1" }, "servers": [ { "url": "", "description": "vvv" } ], "paths": { "/api/WeatherForecast/GetErrorCode": { "get": { "tags": [ "WeatherForecast" ], "summary": "得到一个ErrorCode", "operationId": "WeatherForecast-GetErrorCode", "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/ErrorCode" } }, "application/json": { "schema": { "$ref": "#/components/schemas/ErrorCode" } }, "text/json": { "schema": { "$ref": "#/components/schemas/ErrorCode" } } } } } } }, "/api/WeatherForecast/GetErrorCode2": { "get": { "tags": [ "WeatherForecast" ], "operationId": "WeatherForecast-GetErrorCode2", "parameters": [ { "name": "errorCode", "in": "query", "schema": { "$ref": "#/components/schemas/ErrorCode" } } ], "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/ErrorCode" } }, "application/json": { "schema": { "$ref": "#/components/schemas/ErrorCode" } }, "text/json": { "schema": { "$ref": "#/components/schemas/ErrorCode" } } } } } } }, "/api/WeatherForecast/PostErrorCode": { "post": { "tags": [ "WeatherForecast" ], "summary": "发送一个Post", "operationId": "WeatherForecast-PostErrorCode", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PostErrorCodeDto" } }, "text/json": { "schema": { "$ref": "#/components/schemas/PostErrorCodeDto" } }, "application/*+json": { "schema": { "$ref": "#/components/schemas/PostErrorCodeDto" } } } }, "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/PostErrorCodeDto" } }, "application/json": { "schema": { "$ref": "#/components/schemas/PostErrorCodeDto" } }, "text/json": { "schema": { "$ref": "#/components/schemas/PostErrorCodeDto" } } } } } } }, "/api/WeatherForecast/Get": { "get": { "tags": [ "WeatherForecast" ], "summary": "这是一个Get请求", "operationId": "WeatherForecast-Get", "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/WeatherForecast" } } }, "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/WeatherForecast" } } }, "text/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/WeatherForecast" } } } } } } } } }, "components": { "schemas": { "ErrorCode": { "enum": [ 0, 999, 1000, 1007, 9999, 10000, 10001, 10020, 10030, 10040, 10050, 10060, 10070, 10100, 10140 ], "type": "integer", "description": "注释ErrorCode", "format": "int32" }, "PostErrorCodeDto": { "type": "object", "properties": { "message": { "type": "string", "description": "异常信息", "nullable": true }, "errorCode": { "$ref": "#/components/schemas/ErrorCode" } }, "additionalProperties": false, "description": "请求实体" }, "WeatherForecast": { "type": "object", "properties": { "date": { "type": "string", "format": "date-time" }, "temperatureC": { "type": "integer", "format": "int32" }, "temperatureF": { "type": "integer", "format": "int32", "readOnly": true }, "summary": { "type": "string", "nullable": true } }, "additionalProperties": false } } }, "tags": [ { "name": "WeatherForecast", "description": "中文这是一个Get请求这是一个Get请求" } ] } ```
怎样手动合并此 Pull Request
git checkout dev
git pull https://gitee.com/igeekfan/knife4j.git dev
git push origin dev
评论
0
提交
1
文件
1
检查
代码问题
0
批量操作
展开设置
折叠设置
审查
Code Owner
审查人员
唱诗歌读圣经
bibles
员外
yuanwai
shenkai22
hangzhou_hengjing
千枫飞叶
liuriver
Mr.Tao
tycaa
萧明
xiaoym
未设置
最少人数
0
测试
唱诗歌读圣经
bibles
员外
yuanwai
shenkai22
hangzhou_hengjing
千枫飞叶
liuriver
Mr.Tao
tycaa
萧明
xiaoym
未设置
最少人数
0
优先级
不指定
严重
主要
次要
不重要
标签
标签管理
未设置
关联 Issue
未关联
Pull Request 合并后将关闭上述关联 Issue
里程碑
未关联里程碑
4.6.0
参与者
(1)
Cherry-pick 提交
Cherry-pick 可以将
特定提交(Commit)
从某个分支挑选并应用到另一个分支,实现快速集成特定更改,而无需合并整个分支。
请选择应用 Cherry-pick 提交 (Commit) 的目标分支
新建分支
当前账号不存在 Fork 仓库,建议 cherry-pick 到 Fork 仓库。
Fork 仓库
提交列表
Commit SHA
Commit Message
基于 Cherry-pick 后的分支发起 Pull Request
取消
Cherry-pick
Java
1
https://gitee.com/xiaoym/knife4j.git
git@gitee.com:xiaoym/knife4j.git
xiaoym
knife4j
knife4j
点此查找更多帮助
搜索帮助
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册