Skip to content

Commit

Permalink
Address #175
Browse files Browse the repository at this point in the history
  • Loading branch information
daveshanley committed Feb 14, 2025
1 parent 1f80532 commit 94e6a07
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion builder/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,25 @@ func DigIntoTreeNode[T any](parent *model.TreeNode, field reflect.Value, label s
}
}

func transformLabel(in string) string {
switch in {
case "ONEOF":
return "OneOf"
case "ALLOF":
return "AllOf"
case "ANYOF":
return "AnyOf"
default:
return in
}
}

func DigIntoTreeNodeSlice[T any](parent *model.TreeNode, field reflect.Value, label string) {
if !field.IsZero() {
for k := 0; k < field.Len(); k++ {
f := field.Index(k)
e := &model.TreeNode{
TitleString: label,
TitleString: transformLabel(label),
Key: uuid.New().String(),
IsLeaf: false,
Selectable: false,
Expand Down

0 comments on commit 94e6a07

Please sign in to comment.