Skip to content

Commit

Permalink
Merge pull request #2 from NICEXAI/hotfix-yaml-gen-error
Browse files Browse the repository at this point in the history
fix: fix yaml convert error
  • Loading branch information
NICEXAI authored Sep 22, 2021
2 parents d2f80b9 + a307c42 commit ab3596f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions map2struct.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ func convertMapToCellNode(name string, m map[string]interface{}, tier int) (cn [
fType = "string"
case map[string]interface{}:
fType = "struct"
case map[interface{}]interface{}:
//convert map[interface{}]interface{} to map[string]interface{}
newVal := make(map[string]interface{})
for k, v := range val.(map[interface{}]interface{}) {
strKey := fmt.Sprintf("%v", k)
newVal[strKey] = v
}
val = newVal
fType = "struct"
}

if fType != "struct" {
Expand Down

0 comments on commit ab3596f

Please sign in to comment.