Added oAuth rendering, updated node builder.

This commit is contained in:
Dave Shanley
2023-03-08 10:49:47 -05:00
parent 3544ed0303
commit 38c46fc9dd
6 changed files with 148 additions and 49 deletions

View File

@@ -386,7 +386,32 @@ func SetField(field *reflect.Value, valueNode *yaml.Node, keyNode *yaml.Node) er
field.Set(reflect.ValueOf(ref))
}
}
case reflect.TypeOf(NodeReference[map[KeyReference[string]]ValueReference[string]]{}):
if utils.IsNodeMap(valueNode) {
if field.CanSet() {
items := make(map[KeyReference[string]]ValueReference[string])
var cf *yaml.Node
for i, sliceItem := range valueNode.Content {
if i%2 == 0 {
cf = sliceItem
continue
}
items[KeyReference[string]{
Value: cf.Value,
KeyNode: cf,
}] = ValueReference[string]{
Value: sliceItem.Value,
ValueNode: sliceItem,
}
}
ref := NodeReference[map[KeyReference[string]]ValueReference[string]]{
Value: items,
KeyNode: keyNode,
ValueNode: valueNode,
}
field.Set(reflect.ValueOf(ref))
}
}
case reflect.TypeOf(NodeReference[[]ValueReference[string]]{}):
if utils.IsNodeArray(valueNode) {