【fix sonar】SwitchProperty文件

This commit is contained in:
梁琦涛
2023-03-03 15:10:26 +08:00
parent d223c4c56e
commit 30d6e144c3
@@ -1,5 +1,6 @@
package com.jero.common.util.jsonschema.validate;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jero.common.util.jsonschema.CommonProperty;
@@ -27,15 +28,14 @@ public class SwitchProperty extends CommonProperty {
this.title = title;
this.extendStr = extendStr;
}
@Override
public Map<String, Object> getPropertyJson() {
Map<String,Object> map = new HashMap<>();
map.put("key",getKey());
JSONObject prop = getCommonJson();
JSONArray array = new JSONArray();
if(extendStr!=null) {
array = JSONArray.parseArray(extendStr);
JSONArray array = JSON.parseArray(extendStr);
prop.put("extendOption",array);
}
map.put("prop",prop);