fix(接口测试): idea插件导入的接口,json-schema自动生成结果有误

This commit is contained in:
AgAngle 2024-07-24 16:39:51 +08:00 committed by jianxing
parent 671364ab0a
commit c591162490
1 changed files with 2 additions and 1 deletions

View File

@ -265,7 +265,8 @@ public class JsonSchemaBuilder {
} }
private static String getPropertyTextValue(JsonNode propertyNode, String key) { private static String getPropertyTextValue(JsonNode propertyNode, String key) {
return propertyNode.get(key) == null ? StringUtils.EMPTY : propertyNode.get(key).asText(); JsonNode jsonNode = propertyNode.get(key);
return jsonNode == null || jsonNode instanceof NullNode ? StringUtils.EMPTY : jsonNode.asText();
} }
private static boolean isVariable(String value) { private static boolean isVariable(String value) {