fix: Add field-name for some properties

This commit is contained in:
Ilya Kuznetsov 2025-01-10 21:01:15 +01:00
parent fd88e4c97a
commit 5fb4fa000b
1 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,7 @@
package main package main
import ( import (
"fmt"
"sort" "sort"
"strings" "strings"
@ -72,8 +73,9 @@ func getNodes(s jsonschema.Schema, refs map[string]jsonschema.Schema, customFiel
if len(node.Example) == 0 { if len(node.Example) == 0 {
node.Example = getExample(objectKeyType) node.Example = getExample(objectKeyType)
} }
node.ObjectKeyAttributes = getAttributes(objectKeyType.Properties, refs, customFields, k) prefix := fmt.Sprintf("%s.<%s-name>", k, removePluralForm(k))
rootProps = append(rootProps, extractNodes(k, objectKeyType.Properties, refs, customFields)...) node.ObjectKeyAttributes = getAttributes(objectKeyType.Properties, refs, customFields, prefix)
rootProps = append(rootProps, extractNodes(prefix, objectKeyType.Properties, refs, customFields)...)
} }
if v.Items != nil { if v.Items != nil {