Azure-sdk-for-go: apimanagement: Broken/impossible validation rule for DiagnosticContract

Created on 13 Nov 2020  路  2Comments  路  Source: Azure/azure-sdk-for-go

Bug Report

  • github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement
  • v47.0.0+incompatible
  • go1.14.5 darwin/amd64 (also go1.13.15 darwin/amd64)
  • Trying to create an API Diagnostic using APIDiagnosticClient.CreateOrUpdate()
  • The validation for DiagnosticContract.DiagnosticContractProperties.Sampling.Percentage is invalid
  • This field is a float. Both values passed to the Validate func for the InclusiveMaximum and InclusiveMinimum constraints are int64s
  • Validation fails with
    apimanagement.APIDiagnosticClient#CreateOrUpdate: Invalid input: autorest/validation: validation failed: parameter=parameters.DiagnosticContractProperties.Sampling.Percentage constraint=InclusiveMaximum value=10 details: rule must be float value for InclusiveMaximum constraint; got: 100

References:

API Management bug codegen customer-reported

All 2 comments

Hi @manicminer thanks for this issue!

After a quite brief checking, this should be a code generator issue. I will take a look very shortly. This should be resolved in the next version.

Despite this issue was closed, this bug would not be actually resolved until a new SDK version was released.
We are planning to release a new SDK version with this change on this Thursday

Was this page helpful?
0 / 5 - 0 ratings

Related issues

StrongMonkey picture StrongMonkey  路  4Comments

CecileRobertMichon picture CecileRobertMichon  路  4Comments

yannart picture yannart  路  3Comments

tiwood picture tiwood  路  4Comments

szaher picture szaher  路  4Comments