I had a script I was using for autorest generation that was using autorest 3.0.6306 with autorest/csharp at 2.3.79
I'm trying to upgrade our version of autorest to 3.6.3 with csharp at 3.0.0-beta.20230604.1
The script is fairly basic
$SwashbuckleOutputFile ="removed/for/privacy.json"
$WorkingOutputFile ="removed/for/privacy.json"
$SwaggerDocumentName ="RemovedForPrivacyClient"
$InputApiDll ="./bin/Debug/net6.0/Removed.For.Privacy.dll"
$ClientClassesHomeDirectory ="../Removed/For/Privacy"
dotnet tool restore
dotnet build
dotnet swagger tofile --output $SwashbuckleOutputFile $InputApiDll $SwaggerDocumentName
((Get-Content-path $SwashbuckleOutputFile -Raw) -replace',[\s]+"additionalProperties": (false|\{ \})','') |Set-Content-Path $WorkingOutputFile
npm i --silent autorest
./node_modules/.bin/autorest --csharp --enum-types=true --version=3.6.3--input-file=$WorkingOutputFile --output-folder=$ClientClassesHomeDirectory --use=@autorest/csharp@3.0.0-beta.20230604.1--namespace=Removed.For.Privacy --clear-output-folder --verbose
Everything seems to be proceeding apace until generation seems to just suddenly... stop.
PS /Removed> ./buildAndGenerateSwagger.ps1
Tool 'swashbuckle.aspnetcore.cli' (version '5.6.3') was restored. Available commands: swagger
Restore was successful.
Microsoft (R) Build Engine version 17.2.0+41abc5629 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
All projects are up-to-date for restore.
Project 1-> /Removed.for.privacy.dll
Project 2-> /Removed.For.Privacy.2.dll
Project 3-> Removed.For.Privacy.3.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:03.10
***AWS Cloudwatch logGroupName:
***Log Path:
Swagger JSON/YAML succesfully written to /Removed/For/Privacy.json
+ autorest@3.6.3
updated 1 package and audited 2 packages in 0.95s
1 package is looking for funding
run `npm fund` for details
found 0 vulnerabilities
AutoRest code generation utility [cli version: 3.6.3; node: v12.11.1]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest
info | AutoRest core version selected from configuration: 3.6.3.
info | Loading AutoRest core '...' (3.6.3)
verbose | [0.75 s] Initial configuration file 'file:.../readme.md'
verbose | [0.75 s] Including configuration file 'file:.../readme.md'
verbose | [0.76 s] Including configuration file '.../@autorest/core/dist/resources/default-configuration.md'
verbose | [0.78 s] Including configuration file 'file:.../.autorest/@autorestcore@3.6.3/nodemodules/@autorest/core/dist/resources/inspect.md'
verbose | [0.79 s] Including configuration file 'file:.../.autorest/@autorestcore@3.6.3/nodemodules/@autorest/core/dist/resources/directives.md'
verbose | [0.80 s] Including configuration file 'file:.../.autorest/@autorestcore@3.6.3/nodemodules/@autorest/core/dist/resources/pipeline.md'
verbose | [0.81 s] Including configuration file 'file:.../.autorest/@autorestcore@3.6.3/nodemodules/@autorest/core/dist/resources/loader-openapi.md'
verbose | [0.83 s] Including configuration file 'file:.../.autorest/@autorestcore@3.6.3/nodemodules/@autorest/core/dist/resources/miscellaneous.md'
verbose | [0.84 s] Including configuration file 'file:.../.autorest/@autorestcore@3.6.3/nodemodules/@autorest/core/dist/resources/plugin-powershell.md'
verbose | [0.86 s] Including configuration file 'file:.../.autorest/@autorestcore@3.6.3/nodemodules/@autorest/core/dist/resources/plugin-azureresourceschema.md'
verbose | [0.88 s] Including configuration file 'file:.../.autorest/@autorestcore@3.6.3/nodemodules/@autorest/core/dist/resources/plugin-csharp.md'
verbose | [0.89 s] Including configuration file 'file:.../.autorest/@autorestcore@3.6.3/nodemodules/@autorest/core/dist/resources/plugin-go.md'
verbose | [0.90 s] Including configuration file 'file:.../.autorest/@autorestcore@3.6.3/nodemodules/@autorest/core/dist/resources/plugin-java.md'
verbose | [0.91 s] Including configuration file 'file:.../.autorest/@autorestcore@3.6.3/nodemodules/@autorest/core/dist/resources/plugin-nodejs.md'
verbose | [0.93 s] Including configuration file 'file:.../.autorest/@autorestcore@3.6.3/nodemodules/@autorest/core/dist/resources/plugin-php.md'
verbose | [0.94 s] Including configuration file 'file:.../.autorest/@autorestcore@3.6.3/nodemodules/@autorest/core/dist/resources/plugin-python.md'
verbose | [0.95 s] Including configuration file 'file:.../.autorest/@autorestcore@3.6.3/nodemodules/@autorest/core/dist/resources/plugin-ruby.md'
verbose | [0.97 s] Including configuration file 'file:.../.autorest/@autorestcore@3.6.3/nodemodules/@autorest/core/dist/resources/plugin-typescript.md'
verbose | [0.98 s] Including configuration file 'file:.../.autorest/@autorestcore@3.6.3/nodemodules/@autorest/core/dist/resources/plugin-validators.md'
verbose | [1.00 s] Including configuration file 'file:.../.autorest/@autorestcore@3.6.3/nodemodules/@autorest/core/dist/resources/plugin-az.md'
verbose | [1.01 s] Including configuration file 'file:.../.autorest/@autorestcore@3.6.3/nodemodules/@autorest/core/dist/resources/plugin-terraform.md'
verbose | [1.03 s] Including configuration file 'file:.../.autorest/@autorestcore@3.6.3/nodemodules/@autorest/core/dist/resources/plugin-azure-functions.md'
verbose | [1.04 s] Including configuration file 'file:.../.autorest/@autorestcore@3.6.3/nodemodules/@autorest/core/dist/resources/graphs.md'
verbose | [1.06 s] Including configuration file 'file:.../.autorest/@autorestcore@3.6.3/nodemodules/@autorest/core/dist/resources/help-configuration.md'
info | Loading AutoRest extension '@autorest/csharp' (3.0.0-beta.20230604.1->3.0.0-beta.20230604.1)
verbose | [1.12 s] Including extension configuration file 'file:.../.autorest/@autorestcsharp@3.0.0-beta.20230604.1/nodemodules/@autorest/csharp/readme.md'
verbose | [1.12 s] Including configuration file 'file:.../.autorest/@autorestcsharp@3.0.0-beta.20230604.1/nodemodules/@autorest/csharp/readme.md'
info | Loading AutoRest extension '@autorest/modelerfour' (4.26.0->4.26.0)
verbose | [1.19 s] Including extension configuration file 'file:.../.autorest/@autorestmodelerfour@4.26.0/nodemodules/@autorest/modelerfour/readme.md'
verbose | [1.19 s] Including configuration file 'file:.../.autorest/@autorestmodelerfour@4.26.0/nodemodules/@autorest/modelerfour/readme.md'
verbose | [1.93 s] Reading OpenAPI 3.0 file file:Removed/For/Privacy.json
warning | PreCheck/CheckDuplicateSchemas | Checking for duplicate schemas, this could take a (long) while. Run with --verbose for more detail.
verbose | [2.57 s] Found and removed 0 duplicate schema
And that's it. It just stops there. Hangs dead for the rest of time. I've let it run for hours and it never continues past that point.
I've tried adding and removing stuff from that final command, changing the way it works. The command originally didn't have --csharp
included because that was in the readme (which only has output-folder
, namespace
, and csharp
in it) and I added that. Nothing seems to be changing the fact that this thing just stops after the duplicate check.
The answer was to use version 3.9.6 instead of 3.6.3