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