2

I have installed autorest 3.0.3187 on node v12.16.1 and I ran

autorest --reset 

to remove old versions

However when I run

autorest --input-file=https://myapplication/mydocs/v1/swagger.json --output-folder=generated --csharp --namespace=MyNameSpace

I get the following output

NOTE: AutoRest core version selected from configuration: ~2.0.4413.
Loading AutoRest core      
'C:\Users\kirst\.autorest\@microsoft.azure_autorest- 
core@2.0.4417\node_modules\@microsoft.azure\autorest-core\dist' (2.0.4417)
Loading AutoRest extension '@microsoft.azure/autorest.csharp' (~2.3.79- 
>2.3.84)
Loading AutoRest extension '@microsoft.azure/autorest.modeler' (2.3.55- 
>2.3.55)
FATAL: swagger-document/loader - FAILED
Kirsten
  • 15,730
  • 41
  • 179
  • 318

1 Answers1

1

I added the --v3 switch

autorest --v3 --input-file=https://myapplication/mydocs/v1/swagger.json --output-folder=generated --csharp --namespace=MyNameSpace
Kirsten
  • 15,730
  • 41
  • 179
  • 318
  • 2
    I am really baffled that a newer version is hidden behind some magical flag. I hope they make V3 the default at some point. – Mathias Lykkegaard Lorenzen Jun 02 '21 at 16:08
  • 1
    @MathiasLykkegaardLorenzen your hopes are satisfied, here is the update as of 06/14/21: "⚠️ We have updated the default generator used by autorest --csharp to the new version V3 [...]" (https://github.com/Azure/autorest.csharp) – KhanKhuu Jul 07 '21 at 19:59