You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However on deserialization I get the following exception:
web.SitesClient#GetSite: Failure responding to request: StatusCode=200 -- Original Error: Error occurred unmarshalling JSON - Error = 'json: cannot unmarshal number into Go value of type web.UsageState' JSON = '
I believe the API is returning the Integer value of the UsageState Enum - as opposed to the String value which the Swagger expects - which can be seen in the following snippets from the Go SDK:
// UsageState enumerates the values for usage state.
type UsageState string
const (
// UsageStateExceeded specifies the usage state exceeded state for usage
// state.
UsageStateExceeded UsageState = "Exceeded"
// UsageStateNormal specifies the usage state normal state for usage state.
UsageStateNormal UsageState = "Normal"
)
...
// SiteProperties is
type SiteProperties struct {
Name *string `json:"name,omitempty"`
State *string `json:"state,omitempty"`
HostNames *[]string `json:"hostNames,omitempty"`
RepositorySiteName *string `json:"repositorySiteName,omitempty"`
UsageState UsageState `json:"usageState,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
EnabledHostNames *[]string `json:"enabledHostNames,omitempty"`
AvailabilityState SiteAvailabilityState `json:"availabilityState,omitempty"`
HostNameSslStates *[]HostNameSslState `json:"hostNameSslStates,omitempty"`
ServerFarmID *string `json:"serverFarmId,omitempty"`
LastModifiedTimeUtc *date.Time `json:"lastModifiedTimeUtc,omitempty"`
SiteConfig *SiteConfig `json:"siteConfig,omitempty"`
TrafficManagerHostNames *[]string `json:"trafficManagerHostNames,omitempty"`
PremiumAppDeployed *bool `json:"premiumAppDeployed,omitempty"`
ScmSiteAlsoStopped *bool `json:"scmSiteAlsoStopped,omitempty"`
TargetSwapSlot *string `json:"targetSwapSlot,omitempty"`
HostingEnvironmentProfile *HostingEnvironmentProfile `json:"hostingEnvironmentProfile,omitempty"`
MicroService *string `json:"microService,omitempty"`
GatewaySiteName *string `json:"gatewaySiteName,omitempty"`
ClientAffinityEnabled *bool `json:"clientAffinityEnabled,omitempty"`
ClientCertEnabled *bool `json:"clientCertEnabled,omitempty"`
HostNamesDisabled *bool `json:"hostNamesDisabled,omitempty"`
OutboundIPAddresses *string `json:"outboundIpAddresses,omitempty"`
ContainerSize *int32 `json:"containerSize,omitempty"`
MaxNumberOfWorkers *int32 `json:"maxNumberOfWorkers,omitempty"`
CloningInfo *CloningInfo `json:"cloningInfo,omitempty"`
ResourceGroup *string `json:"resourceGroup,omitempty"`
IsDefaultContainer *bool `json:"isDefaultContainer,omitempty"`
DefaultHostName *string `json:"defaultHostName,omitempty"`
}
Upon further inspection of the Response - I believe that this is the case for the other Enum's within the Go SDK package too - to pick from the JSON in this case:
siteDisabledReason
contentAvailabilityState
runtimeAvailabilityState
ipBasedSslState
sslState
hostType
availabilityState
I've previously filed issue #841 which is very similar - and I'm wondering if this affects the other Enum related fields in the WebApps SDK? Would it be possible for someone to take a look into this for me please? Thanks in advance :)
Related: I'm aware this Repository is technically for the Swagger rather than API bugs - please let me know if I should be filing these kind of issues somewhere else :)
Thanks!
The text was updated successfully, but these errors were encountered:
I have also seen similar bugs in the API. I believe there are more instances that need to be inspected as they are returning Integer values instead of their respective Enum types. The additional list to the above is:
👋 ¡hōla!
I've been continuing on my quest to bring support for WebApps to Terraform - however I believe I've encountered some contract-related bugs in the API:
When I make the following Request via the Go SDK:
The request succeeds and I get the following Response back from the API:
However on deserialization I get the following exception:
I believe the API is returning the Integer value of the
UsageState
Enum - as opposed to the String value which the Swagger expects - which can be seen in the following snippets from the Go SDK:Upon further inspection of the Response - I believe that this is the case for the other Enum's within the Go SDK package too - to pick from the JSON in this case:
I've previously filed issue #841 which is very similar - and I'm wondering if this affects the other Enum related fields in the WebApps SDK? Would it be possible for someone to take a look into this for me please? Thanks in advance :)
Related: I'm aware this Repository is technically for the Swagger rather than API bugs - please let me know if I should be filing these kind of issues somewhere else :)
Thanks!
The text was updated successfully, but these errors were encountered: