hashicorp / pandora

A suite of single-purpose tools enabling automation for Terraform/Azure
Mozilla Public License 2.0
66 stars 49 forks source link

missing model in "recoveryservicesiterecovery" #1864

Open ziyeqf opened 1 year ago

ziyeqf commented 1 year ago

in the swagger there is a model named DisableProtectionProviderSpecificInput. but generated sdk only contains InMageDisableProtectionProviderSpecificInput.

tombuildsstuff commented 1 year ago

@ziyeqf looks fine to me? https://github.com/hashicorp/go-azure-sdk/blob/9e71875588ddcfc8a8cd140f65dea1438be3a370/resource-manager/recoveryservicessiterecovery/2022-10-01/replicationprotecteditems/model_inmagedisableprotectionproviderspecificinput.go#LL11

ziyeqf commented 1 year ago

@tombuildsstuff we need DisableProtectionProviderSpecificInput struct but we only have an interface. It seems a little wired to me accroding to the swagger, but the API only accept requests with that.

like the line4044@azure-sdk-for-go

tombuildsstuff commented 1 year ago

@ziyeqf DisableProtectionProviderSpecificInput isn't a valid discriminator type, a Discriminator must have two things:

  1. A Parent type with the discriminator field
  2. One or more types implementing that Parent Type (via allOf) with a x-ms-discriminator-value (for example InMageDisableProtectionProviderSpecificInput: https://github.com/Azure/azure-rest-api-specs/blob/2278f5552561a7959a49a1e38cb7ddbb349d1589/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/service.json#LL14536)

Since DisableProtectionProviderSpecificInput is the Parent Type there isn't a discriminator for it.. could you highlight where this is being used?

ziyeqf commented 1 year ago

@tombuildsstuff I get the point. The usage is https://github.com/hashicorp/terraform-provider-azurerm/blob/main/internal/services/recoveryservices/site_recovery_replicated_vm_resource.go#L621

tombuildsstuff commented 1 year ago

@ziyeqf sent a PR to introduce a base type to fix this: https://github.com/Azure/azure-rest-api-specs/pull/21652