From 5fb4fa000bfa750f2e5219a1f953df3f77180854 Mon Sep 17 00:00:00 2001 From: Ilya Kuznetsov Date: Fri, 10 Jan 2025 21:01:15 +0100 Subject: [PATCH] fix: Add field-name for some properties --- bundle/internal/docs/nodes.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bundle/internal/docs/nodes.go b/bundle/internal/docs/nodes.go index 4507de08a..ae8fa9efd 100644 --- a/bundle/internal/docs/nodes.go +++ b/bundle/internal/docs/nodes.go @@ -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 {