Skip to content

Commit

Permalink
Fix panic in 'azurerm_api_management_operation' (hashicorp#5273)
Browse files Browse the repository at this point in the history
Fix panic in 'azurerm_api_management_operation'

Recreatd hashicorp#5243 after the changes to the provider organization.
  • Loading branch information
Brunhil authored and Jack Batzner committed Dec 31, 2019
1 parent b2fdea1 commit c6386d1
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,15 +250,27 @@ func expandApiManagementOperationRequestContract(input []interface{}) (*apimanag
}

vs := input[0].(map[string]interface{})
if vs == nil {
return nil, nil
}
description := vs["description"].(string)

headersRaw := vs["header"].([]interface{})
if headersRaw == nil {
headersRaw = []interface{}{}
}
headers := azure.ExpandApiManagementOperationParameterContract(headersRaw)

queryParametersRaw := vs["query_parameter"].([]interface{})
if queryParametersRaw == nil {
queryParametersRaw = []interface{}{}
}
queryParameters := azure.ExpandApiManagementOperationParameterContract(queryParametersRaw)

representationsRaw := vs["representation"].([]interface{})
if representationsRaw == nil {
representationsRaw = []interface{}{}
}
representations, err := azure.ExpandApiManagementOperationRepresentation(representationsRaw)
if err != nil {
return nil, err
Expand Down

0 comments on commit c6386d1

Please sign in to comment.