Skip to content

Commit

Permalink
Fix panic in 'azurerm_api_management_operation'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack Batzner committed Dec 23, 2019
1 parent 6e006ff commit 9511575
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions azurerm/resource_arm_api_management_api_operation.go
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, fmt.Errorf("Error mapping input")
}
description := vs["description"].(string)

headersRaw := vs["header"].([]interface{})
if headersRaw == nil {
return nil, fmt.Errorf("Error mapping `header`")
}
headers := azure.ExpandApiManagementOperationParameterContract(headersRaw)

queryParametersRaw := vs["query_parameter"].([]interface{})
if queryParametersRaw == nil {
return nil, fmt.Errorf("Error mapping `query_parameter`")
}
queryParameters := azure.ExpandApiManagementOperationParameterContract(queryParametersRaw)

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

0 comments on commit 9511575

Please sign in to comment.