Skip to content

Commit d988d6b

Browse files
author
Cerber Ursi
committed
explicitly check schema type for nilness
1 parent 17824da commit d988d6b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

schemav3.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ func IsComplexSchemaV3(schema *SchemaV3) bool {
2121
return true
2222
}
2323

24+
// a schema without type (i.e. `any`) cannot be complex
25+
if schema.Type == nil {
26+
return false
27+
}
28+
2429
// a deep array type is complex, how to determine deep? here more than 2 ,for example: [][]object,[][][]int
2530
if len(*schema.Type) > 2 {
2631
return true

0 commit comments

Comments
 (0)