Skip to content

Commit

Permalink
Merge branch 'main' into chore/bump-go-apiops
Browse files Browse the repository at this point in the history
  • Loading branch information
Prashansa-K authored Sep 12, 2024
2 parents 6123c26 + 5f3068b commit d8571f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions kong2tf/generate_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,9 @@ func outputList(entityType string, key string, input []interface{}, depth int) s

// Ends a list rendering in Go
func endList(input []interface{}, depth int) string {
if len(input) == 0 {
return "]\n"
}
lastLine := line("]", depth, "\n")
if _, ok := input[len(input)-1].(map[string]interface{}); ok {
return lastLine
Expand Down
4 changes: 3 additions & 1 deletion kong2tf/generate_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ func TestGenerateComplexLayout(t *testing.T) {
"nested_nested_nested_field1": "nested_nested_nested_string"
}
}
}
},
"field4": []
}`

var entity map[string]any
Expand All @@ -43,6 +44,7 @@ func TestGenerateComplexLayout(t *testing.T) {
}
}
}
field4 = []
service = {
id = konnect_gateway_service.some_service.id
Expand Down

0 comments on commit d8571f5

Please sign in to comment.