VSChina / magic-modules

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

MM doesn't support StringMapObject type #24

Closed neil-yechenwei closed 5 years ago

neil-yechenwei commented 5 years ago

api.yml: '/tags': !ruby/object:Api::Azure::SDKTypeDefinition::StringMapObject go_field_name: Tags python_field_name: tags

!ruby/object:Api::Azure::Type::Tags name: 'tags' description: 'Resource tags.' required: false input: true azure_sdk_references: ['tags', '/tags'] basic.yml: tags: env: "test"

.go: "tags": tags.Schema(),

resource.TestCheckResourceAttr(resourceName, "tags.#", "1"), resource.TestCheckResourceAttr(resourceName, "tags.0.env", "test"),

fix in .go: It should be like below code. resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.env", "test"),

houkms commented 5 years ago

This is actually a property expanding problem of Map structure in Magic-Modules and is resolved in PR #30

mybayern1974 commented 5 years ago

@neil-yechenwei , could you please verify whether the fix works and accordingly close this PR?

houkms commented 5 years ago

Closed due to no further response. @neil-yechenwei you can reopen it if it happens again.