Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Fix - azurerm_api_management_api_operation] - Handling example.value none-string types #14848

Merged
merged 4 commits into from
Apr 7, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rename func name
xuzhang3 committed Mar 30, 2022
commit 68202d3d59aba97863ccf84061037d64b0ca7389
6 changes: 3 additions & 3 deletions internal/services/apimanagement/schemaz/api_management.go
Original file line number Diff line number Diff line change
@@ -204,7 +204,7 @@ func FlattenApiManagementOperationRepresentation(input *[]apimanagement.Represen
output["example"] = example

if !features.ThreePointOhBeta() && v.Examples["default"] != nil && v.Examples["default"].Value != nil {
value, err := convert2String(v.Examples["default"].Value)
value, err := convert2Json(v.Examples["default"].Value)
if err != nil {
return nil, err
}
@@ -438,7 +438,7 @@ func FlattenApiManagementOperationParameterExampleContract(input map[string]*api
// value can be any type, may be a primitive value or an object
// https://github.com/Azure/azure-sdk-for-go/blob/main/services/apimanagement/mgmt/2021-08-01/apimanagement/models.go#L10236
if v.Value != nil {
value, err := convert2String(v.Value)
value, err := convert2Json(v.Value)
if err != nil {
return nil, err
}
@@ -472,7 +472,7 @@ func CopyCertificateAndPassword(vals []interface{}, hostName string, output map[
}
}

func convert2String(rawVal interface{}) (string, error) {
func convert2Json(rawVal interface{}) (string, error) {
value := ""
if val, ok := rawVal.(string); ok {
value = val