已知问题修复 #7
| @ -106,6 +106,11 @@ func (oj *ownJson) generateStructField(rootPath string, currentName string, curr | |||||||
| 	if currentResult.IsArray() { | 	if currentResult.IsArray() { | ||||||
| 		// 数组, 递归处理 | 		// 数组, 递归处理 | ||||||
| 		arrList := currentResult.Array() | 		arrList := currentResult.Array() | ||||||
|  | 		if len(arrList) == 0 { | ||||||
|  | 			// 空数组,无法判断类型,使用any | ||||||
|  | 			oj.structBuilder.AddField(structPath, "", []any{}, "", false) | ||||||
|  | 			return | ||||||
|  | 		} | ||||||
| 		if arrList[0].Type == gjson.True || arrList[0].Type == gjson.False { | 		if arrList[0].Type == gjson.True || arrList[0].Type == gjson.False { | ||||||
| 			oj.structBuilder.AddField(structPath, "", []bool{}, "", false) | 			oj.structBuilder.AddField(structPath, "", []bool{}, "", false) | ||||||
| 			return | 			return | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user