VSChina / magic-modules

Magic Modules: Automagically generate Google Cloud Platform support for OSS
Apache License 2.0
1 stars 4 forks source link

MM defined incorrect tags variable in expand function #20

Closed neil-yechenwei closed 4 years ago

neil-yechenwei commented 5 years ago

Error: azurerm\resource_arm_private_link_service.go:844:19: tags.Expand undefined (type map[string]interface {} has no field or method Expand) azurerm\resource_arm_private_link_service.go:844:27: undefined: t

func expandArmPrivateLinkServicePrivateEndpoint(input []interface{}) *network.PrivateEndpoint { if len(input) == 0 { return nil } v := input[0].(map[string]interface{}) id := v["id"].(string) location := azure.NormalizeLocation(v["location"].(string)) tags := v["tags"].(map[string]interface{}) etag := v["etag"].(string) result := network.PrivateEndpoint{ Etag: utils.String(etag), ID: utils.String(id), Location: utils.String(location), Tags: tags.Expand(t), } return &result }

houkms commented 5 years ago

@neil-yechenwei Which one in this case is wrong? Can you help attach your api.yaml file link here?

JunyiYi commented 5 years ago

@houkms the error here is tags := v["tags"].(map[string]interface{}), while we are using it in Tags: tags.Expand(t), therefore undefined: t error pops up.

I renamed tags to t because the latest standard is using t instead of tags. But I only handle it in the root properties, I did not expect any Azure sub-properties to contain tags. Obviously in this case we have a sub-property tags.

So here we have two TODO items:

houkms commented 4 years ago

This issue is solved in #49