fix: Allow empty fields

This commit is contained in:
Ilya Kuznetsov 2025-01-13 15:28:41 +01:00
parent c88498eb56
commit 3e0d2324b5
No known key found for this signature in database
GPG Key ID: 91F3DDCF5D21CDDF
1 changed files with 1 additions and 5 deletions

View File

@ -82,12 +82,8 @@ func getNodes(s jsonschema.Schema, refs map[string]jsonschema.Schema, customFiel
node.ArrayItemAttributes = getAttributes(arrayItemType.Properties, refs, customFields, k)
}
isEmpty := node.Description == "" && len(node.Attributes) == 0 && len(node.ObjectKeyAttributes) == 0 && len(node.ArrayItemAttributes) == 0
shouldAddNode := !isEmpty || node.TopLevel
if shouldAddNode {
nodes = append(nodes, node)
}
}
sort.Slice(nodes, func(i, j int) bool {
return nodes[i].Title < nodes[j].Title