Skip to content

Commit

Permalink
update flatten properties to handle slices instead of arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
jcvrabo committed Mar 7, 2024
1 parent f0b7bb9 commit d4dc663
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sources/git_source/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,13 @@ func flattenProperties(prefix string, object interface{}, properties *map[string
errors.AddError(e)
}
}
case reflect.Slice:
// if it's an array we expect it to be a type of []]interface{}
for i, value := range object.([]interface{}) {
if e := flattenProperties(prefix+"["+strconv.Itoa(i)+"]", value, properties); e != nil {
errors.AddError(e)
}
}
case reflect.Array:
// if it's an array we expect it to be a type of []]interface{}
for i, value := range object.([]interface{}) {
Expand Down

0 comments on commit d4dc663

Please sign in to comment.