【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; package com.jero.common.util.jsonschema.validate;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jero.common.util.jsonschema.CommonProperty; import com.jero.common.util.jsonschema.CommonProperty;
@@ -33,9 +34,8 @@ public class SwitchProperty extends CommonProperty {
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("key",getKey()); map.put("key",getKey());
JSONObject prop = getCommonJson(); JSONObject prop = getCommonJson();
JSONArray array = new JSONArray();
if(extendStr!=null) { if(extendStr!=null) {
array = JSONArray.parseArray(extendStr); JSONArray array = JSON.parseArray(extendStr);
prop.put("extendOption",array); prop.put("extendOption",array);
} }
map.put("prop",prop); map.put("prop",prop);