-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PowerShell build error due to variable naming #767
Comments
The issue should have been fixed in autorest.powershell v4. |
@dolauli Where is v4? I write a normal script like below
and PS D:\Source\Repos\Resa\IpTables.Api\Source\BSN.IpTables.Cli> .\Generate-PowerShellClient.ps1
changed 1 package in 252ms
AutoRest code generation utility [cli version: 3.6.3; node: v18.15.0]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest
info | Loading AutoRest core 'C:\Users\sooro\.autorest\@[email protected]\nodemodules\@autorest\core\dist' (3.9.7)
info |
The default version of @autorest/powershell has been bumped from 2.1+ to 3.0+.
> If you still want to use 2.1+ version, please specify it with --use:@autorest/[email protected].{x}, e.g 2.1.401.
info | Loading AutoRest extension '@autorest/powershell' (~3.0.0->3.0.505)
info | Loading AutoRest extension '@autorest/modelerfour' (4.15.414->4.15.414)
verbose | [1.53 s] Reading OpenAPI 3.0 file file:///D:/Source/Repos/Resa/IpTables.Api/Source/BSN.IpTables.Api/swagger.json
warning | PreCheck/CheckDuplicateSchemas | Checking for duplicate schemas, this could take a (long) while. Run with --verbose for more detail.
verbose | [1.74 s] ModelerFour/api-version-mode:client
verbose | [1.74 s] ModelerFour/api-version-parameter:constant
verbose | [1.74 s] ModelerFour/use-model-namespace:false
info | Autorest completed in 2.46s. 206 files generated. |
related to BSVN/IpTables.Api#22 |
I try to specify version be below code (as I learn from Azure/autorest#2976)
But I got below errors
|
I found some workaround about that, with specific version in thanks |
After AutoRest generation based on my team’s Swagger spec, the below build error occurs when running build-module.ps1
D:\a\1\s\src\ProviderHub\generated\api\Models\Api20201120\ProviderRegistrationPropertiesProviderHubMetadata.cs(6,9): error CS0535: 'ProviderRegistrationPropertiesProviderHubMetadata' does not implement interface member 'IProviderHubMetadata.ThirdPartyProviderAuthorizationAuthorizations' [D:\a\1\s\src\ProviderHub\Az.ProviderHub.csproj]
D:\a\1\s\src\ProviderHub\generated\api\Models\Api20201120\ProviderRegistrationPropertiesProviderHubMetadata.cs(7,9): error CS0738: 'ProviderRegistrationPropertiesProviderHubMetadata' does not implement interface member 'IProviderHubMetadataInternal.ThirdPartyProviderAuthorization'. 'ProviderRegistrationPropertiesProviderHubMetadata.ThirdPartyProviderAuthorization' cannot implement 'IProviderHubMetadataInternal.ThirdPartyProviderAuthorization' because it does not have the matching return type of 'IThirdPartyProviderAuthorization'. [D:\a\1\s\src\ProviderHub\Az.ProviderHub.csproj]
D:\a\1\s\src\ProviderHub\generated\api\Models\Api20201120\ProviderRegistrationPropertiesProviderHubMetadata.cs(7,9): error CS0535: 'ProviderRegistrationPropertiesProviderHubMetadata' does not implement interface member 'IProviderHubMetadataInternal.ThirdPartyProviderAuthorizationAuthorizations' [D:\a\1\s\src\ProviderHub\Az.ProviderHub.csproj]
Here is the link to the specific property in our Swagger:
https://github.com/Azure/azure-rest-api-specs/blob/master/specification/providerhub/resource-manager/Microsoft.ProviderHub/stable/2020-11-20/providerhub.json#L3629
We have another property called “providerAuthorizations” and I noticed that if I change this field from “authorizations” to something other than authorization/providerAuthorizations there is no error during the build.
The text was updated successfully, but these errors were encountered: