Skip to content

Commit

Permalink
Throw error if both examples and sample are provided
Browse files Browse the repository at this point in the history
  • Loading branch information
oWretch committed Nov 30, 2021
1 parent c44b678 commit c713281
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/services/apimanagement/schemaz/api_management.go
Expand Up @@ -134,6 +134,9 @@ func ExpandApiManagementOperationRepresentation(d *pluginsdk.ResourceData, schem

examples := make(map[string]*apimanagement.ParameterExampleContract, 0)
if vs["examples"] != nil {
if vs["sample"] != nil {
return nil, fmt.Errorf("Only one of `examples` and `sample` can be provided at the same time.")
}
examples = ExpandApiManagementOperationParameterExampleContract(vs["examples"].([]interface{}))
} else if vs["sample"] != nil {
defaultExample := map[string]interface{}{
Expand Down

0 comments on commit c713281

Please sign in to comment.