autorest icon indicating copy to clipboard operation
autorest copied to clipboard

azure-sdk-for-net Export-API.ps1 servicelinker step fails due to some model renaming error

Open us6193 opened this issue 1 year ago • 0 comments

Before filling a bug

  • [x] have you checked the faq for known issues.
  • [x] have you checked existing issues

Describe the bug

Hello,

We recently created a new GA version: https://learn.microsoft.com/en-us/rest/api/billing/?view=rest-billing-2024-04-01.
Now we are following this TSG to generate .net SDK: https://eng.ms/docs/products/azure-developer-experience/develop/sdk-generate-mgmt-dotnet.

On step #2: Generate the API file with the following command, review it and update any SDK API if it does not follow the [.NET Azure SDK Design Guidelines](https://azure.github.io/azure-sdk/dotnet_introduction.html) with [mgmt configurations](https://github.com/Azure/autorest.csharp/blob/feature/v3/docs/mgmt/readme.md#management-plane-configurations) in autorest.md. Then regenerate the API file.
<RepoRoot>\sdk\servicelinker\Azure.ResourceManager.ServiceLinker>..\..\..\eng\scripts\Export-API.ps1 servicelinker

We are seeing below errors:

Build FAILED.

C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Generated\Models\CheckAccessResponse.cs(14,26): error AZC0030: Model name 'CheckAccessResponse' ends with 'Response'. Su
ggest to rename it to 'CheckAccessResult' or any other appropriate name. [C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Azure.ResourceManager.Billing.csproj::TargetFr
amework=netstandard2.0]
C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Generated\Models\CheckAccessRequest.cs(14,26): error AZC0030: Model name 'CheckAccessRequest' ends with 'Request'. Sugge
st to rename it to 'CheckAccessContent' or any other appropriate name. [C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Azure.ResourceManager.Billing.csproj::TargetFram
ework=netstandard2.0]
C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Generated\Models\AcceptTransferRequest.cs(14,26): error AZC0030: Model name 'AcceptTransferRequest' ends with 'Request'.
 Suggest to rename it to 'AcceptTransferContent' or any other appropriate name. [C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Azure.ResourceManager.Billing.csproj::T
argetFramework=netstandard2.0]
C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Generated\Models\AddressValidationResponse.cs(14,26): error AZC0030: Model name 'AddressValidationResponse' ends with 'R
esponse'. Suggest to rename it to 'AddressValidationResult' or any other appropriate name. [C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Azure.ResourceManager.Billin
g.csproj::TargetFramework=netstandard2.0]
C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Generated\Models\MoveProductRequest.cs(14,26): error AZC0030: Model name 'MoveProductRequest' ends with 'Request'. Sugge
st to rename it to 'MoveProductContent' or any other appropriate name. [C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Azure.ResourceManager.Billing.csproj::TargetFram
ework=netstandard2.0]
C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Generated\Models\RenewPropertiesResponse.cs(14,26): error AZC0030: Model name 'RenewPropertiesResponse' ends with 'Respo
nse'. Suggest to rename it to 'RenewPropertiesResult' or any other appropriate name. [C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Azure.ResourceManager.Billing.cspr
oj::TargetFramework=netstandard2.0]
C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Generated\Models\DocumentDownloadRequest.cs(14,26): error AZC0030: Model name 'DocumentDownloadRequest' ends with 'Reque
st'. Suggest to rename it to 'DocumentDownloadContent' or any other appropriate name. [C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Azure.ResourceManager.Billing.csp
roj::TargetFramework=netstandard2.0]
C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Generated\Models\PurchaseRequest.cs(14,26): error AZC0030: Model name 'PurchaseRequest' ends with 'Request'. Suggest to
rename it to 'PurchaseContent' or any other appropriate name. [C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Azure.ResourceManager.Billing.csproj::TargetFramework=net
standard2.0]
C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Generated\Models\ReservationPurchaseRequest.cs(15,26): error AZC0030: Model name 'ReservationPurchaseRequest' ends with
'Request'. Suggest to rename it to 'ReservationPurchaseContent' or any other appropriate name. [C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Azure.ResourceManager.Bi
lling.csproj::TargetFramework=netstandard2.0]
C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Generated\Models\SavingsPlanValidateResponse.cs(14,26): error AZC0030: Model name 'SavingsPlanValidateResponse' ends wit
h 'Response'. Suggest to rename it to 'SavingsPlanValidateResult' or any other appropriate name. [C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Azure.ResourceManager.
Billing.csproj::TargetFramework=netstandard2.0]
C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Generated\Models\ValidateTransferResponse.cs(14,26): error AZC0030: Model name 'ValidateTransferResponse' ends with 'Res
ponse'. Suggest to rename it to 'ValidateTransferResult' or any other appropriate name. [C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Azure.ResourceManager.Billing.c
sproj::TargetFramework=netstandard2.0]
    0 Warning(s)
    11 Error(s)

Time Elapsed 00:00:07.90
PS C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net>



Expected behavior We have not seen similar issues on any other language SDK.

  1. How can we suppress these errors?
  2. If suppression is not the correct way, can you please provide correct guidance to fix it?
  • Does it need to be fixed in generated SDK files?
  • Does that demand a swagger change too? Or just add the renaming mapping to autorest.md.

Additional context Add any other context about the problem here.

us6193 avatar Aug 27 '24 17:08 us6193