Closed gearama closed 3 weeks ago
given the following operation definition : /**
@summary("Restores a backed up secret to a vault.") @route("/secrets/restore") @post op restoreSecret is Azure.Core.Foundations.Operation< { /**
@body @flattenProperty parameters: SecretRestoreParameters; }, SecretBundle
;
the generated code is
Azure::Response RestoreSecret(std::string const& apiVersion, SecretRestoreParameters const& parameters, Azure::Core::Context const& context = {}) ;
which is as expected
Adding the following defintion to the client.tsp : @override(KeyVault.restoreSecret,"cpp") /**
@summary("Restores a backed up secret to a vault.") @post op restoreSecretCustomized is Azure.Core.Foundations.Operation< { /**
@body @flattenProperty parameters: SecretRestoreParameters; }, BackupSecretResult
; the following code gets emitted
two methods with the same signature
i would expect one with the return type of BackupSecretResult not two with KeyVaultSecret or at least one with the right definition
at least that is my understanding based on https://azure.github.io/typespec-azure/docs/libraries/typespec-client-generator-core/reference/decorators#@Azure.ClientGenerator.Core.override Decorators | TypeSpec Azure Azure.ClientGenerator.Core
given the following operation definition : /**
suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Foundations.Operation is necessary for Key Vault"
@summary("Restores a backed up secret to a vault.") @route("/secrets/restore") @post op restoreSecret is Azure.Core.Foundations.Operation< { /**
suppress "deprecated" "Property flattening is supported for legacy scenarios like Key Vault's"
@body @flattenProperty parameters: SecretRestoreParameters; }, SecretBundle
the generated code is
Azure::Response RestoreSecret(std::string const& apiVersion, SecretRestoreParameters const& parameters, Azure::Core::Context const& context = {}) ;
which is as expected
Adding the following defintion to the client.tsp : @override(KeyVault.restoreSecret,"cpp") /**
suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Foundations.Operation is necessary for Key Vault"
@summary("Restores a backed up secret to a vault.") @post op restoreSecretCustomized is Azure.Core.Foundations.Operation< { /**
suppress "deprecated" "Property flattening is supported for legacy scenarios like Key Vault's"
@body @flattenProperty parameters: SecretRestoreParameters; }, BackupSecretResult
Azure::Response RestoreSecret(std::string const& apiVersion, SecretRestoreParameters const& parameters, Azure::Core::Context const& context = {}) ;
Azure::Response RestoreSecret(std::string const& apiVersion, SecretRestoreParameters const& parameters, Azure::Core::Context const& context = {}) ;
two methods with the same signature
i would expect one with the return type of BackupSecretResult not two with KeyVaultSecret or at least one with the right definition
at least that is my understanding based on https://azure.github.io/typespec-azure/docs/libraries/typespec-client-generator-core/reference/decorators#@Azure.ClientGenerator.Core.override Decorators | TypeSpec Azure Azure.ClientGenerator.Core