mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-10 12:37:48 +00:00
Added oAuth rendering, updated node builder.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user