我有一个用于生成autorest的脚本,它使用autorest 3.0.6306和2.3.79的autorest/csharp
我正在尝试将我们的autorest版本升级到3.6.3,csharp为3.0.0-beta.20230604.1
脚本是相当基本的
$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
一切似乎都在快速进行,直到一代似乎突然...别说了。
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
就是这样就停在那里。剩下的时间就挂在那里了。我已经让它运行了几个小时,它从来没有继续过去的点。
我试着在最后一个命令中添加和删除一些东西,改变它的工作方式。该命令最初没有包含--csharp
,因为它在自述文件中(其中只有output-folder
,namespace
和csharp
),我添加了它。似乎没有什么能改变这件事在重复检查后就停止的事实。
1条答案
按热度按时间68bkxrlz1#
答案是使用版本3.9.6而不是3.6.3