Fixing minor issues such as weakly typed decoding
diff --git a/openstack/db/v1/flavors/results.go b/openstack/db/v1/flavors/results.go
index 2089f67..2cee010 100644
--- a/openstack/db/v1/flavors/results.go
+++ b/openstack/db/v1/flavors/results.go
@@ -21,7 +21,12 @@
Flavor Flavor `mapstructure:"flavor"`
}
- err := mapstructure.Decode(gr.Body, &result)
+ decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{
+ WeaklyTypedInput: true,
+ Result: &result,
+ })
+
+ err = decoder.Decode(gr.Body)
return &result.Flavor, err
}
@@ -76,6 +81,12 @@
Flavors []Flavor `mapstructure:"flavors"`
}
- err := mapstructure.Decode(casted, &container)
+ decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{
+ WeaklyTypedInput: true,
+ Result: &container,
+ })
+
+ err = decoder.Decode(casted)
+
return container.Flavors, err
}