Skip to content

Commit 4eedc26

Browse files
tools/importer-rest-api-specs: extending the workaround for Azure/azure-rest-api-specs#27351 to account for the constant being incorrectly defined
This should be explicitly defined as an integer, since `number` means float.
1 parent bffd8b0 commit 4eedc26

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tools/importer-rest-api-specs/components/parser/dataworkarounds/workaround_botservice_27351.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package dataworkarounds
22

33
import (
44
"fmt"
5+
"github.com/hashicorp/pandora/tools/sdk/resourcemanager"
56

67
"github.com/hashicorp/go-azure-helpers/lang/pointer"
78
"github.com/hashicorp/pandora/tools/importer-rest-api-specs/models"
@@ -66,6 +67,14 @@ func (workaroundBotService27351) Process(input models.AzureApiDefinition) (*mode
6667
resource.Operations[operationName] = operation
6768
}
6869

70+
// ensure the Constant `EmailChannelAuthMethod` is updated to be an Integer rather than a Float
71+
constant, ok := resource.Constants["EmailChannelAuthMethod"]
72+
if !ok {
73+
return nil, fmt.Errorf("expected a Constant named `EmailChannelAuthMethod` but didn't get one")
74+
}
75+
constant.Type = resourcemanager.IntegerConstant
76+
resource.Constants["EmailChannelAuthMethod"] = constant
77+
6978
output.Resources["Channel"] = resource
7079

7180
return &output, nil

0 commit comments

Comments
 (0)