Skip to content

Commit

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

Recreatd #5243 after the changes to the provider organization.
  • Loading branch information
Brunhil authored and katbyte committed Dec 30, 2019
1 parent 387db78 commit c7fa512
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 c7fa512

Please sign in to comment.