Skip to content

Commit

Permalink
PR Comments resolved
Browse files Browse the repository at this point in the history
- Don't return error when mapping cannot occur
- Conditionally assign value for 'header', 'query_parameter', 'representation'
  • Loading branch information
Jack Batzner committed Dec 30, 2019
1 parent 51d44c9 commit 0a3e887
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,25 +251,25 @@ func expandApiManagementOperationRequestContract(input []interface{}) (*apimanag

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

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

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

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

0 comments on commit 0a3e887

Please sign in to comment.