问题描述
我正在尝试通过以下代码使用扩展选择参数插件中的“JSON Parameter Config Groovy Script”选项。当在“https://www.jeremydorn.com/json-editor”上测试 JSON 模式时,我能够看到项目的添加和删除按钮,但在 Jenkins 中测试时看到相同的 JSON 模式,我没有得到按钮。请帮我解决这个问题。
JSON 架构
import net.sf.json.JSONObject
def jsoneditorOptions = JSONObject.fromObject(/{
disable_edit_json: true,disable_properties: true,no_additional_properties: true,disable_collapse: true,disable_array_add: true,disable_array_delete: true,disable_array_reorder: true,theme: "bootstrap3",iconlib:"fontawesome5","keep_oneof_values": true,"object_layout": "normal","template": "default","show_errors": "interaction","prompt_before_delete": true,schema: {
"type": "object","title": "System Test","properties": {
"HttpProcessor": {
"type": "array","format": "table","title": "HttpProcessor","uniqueItems": true,"items": {
"type": "object","title": "Add API","required":["type","TPS"],"properties": {
"type": {
"type": "string","enum": [
"CreateAndissue","Redeem","Reload","CancelRedeem","CancelCreateAndissue"
],"default": "CreateAndissue"
},"TPS": {
"type": "string"
}
}
},"default": [{
"type": "CreateAndissue","TPS": "1"
}]
}
}
}
}/);
Json-Editor 输出
詹金斯输出
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)