fix(接口定义): #1006839 【接口定义】jsonschema设置默认值,生成的测试数据没取到该值

【【接口定义】jsonschema设置默认值,生成的测试数据没取到该值】https://www.tapd.cn/55049933/bugtrace/bugs/view?bug_id=1155049933001006839
This commit is contained in:
song-tianyang 2021-09-22 19:43:39 +08:00 committed by song-tianyang
parent 4d2e35b9f0
commit 6271d90ce1
2 changed files with 4 additions and 2 deletions

View File

@ -103,7 +103,9 @@ public class JSONSchemaGenerator {
} }
} }
if (object.has("enum")) { if(object.has("default")){
concept.put(propertyName, object.get("default"));
}else if (object.has("enum")) {
concept.put(propertyName, analyzeEnumProperty(object)); concept.put(propertyName, analyzeEnumProperty(object));
} else if (propertyObjType.equals("string")) { } else if (propertyObjType.equals("string")) {
// 先设置空值 // 先设置空值

@ -1 +1 @@
Subproject commit fd37bcf9408177e13747cd0cf4f03781bb35d97b Subproject commit 8f10fac36134bfe4d9520051fdf1cfb9b44f67e4