Open fairking opened 2 years ago
For those who has the same error the following workaround might help:
I used the swagger-codegen and it worked fine.
cd "C:\Program Files (x86)\Java\jre1.8.0_321\bin"
java -jar "C:\Users\Admin\Downloads\swagger-codegen-cli-2.4.26.jar" generate -i https://eazycollectservices.github.io/EazyCollectAPIv3/swagger.json -l csharp -o C:\Code\MyProject
It will generate everything for you. You can also look at the other options by the following command: java -jar "C:\Users\Admin\Downloads\swagger-codegen-cli-2.4.26.jar" config-help -l csharp
.
where the C:\Code\MyProject
is your project folder.
Hope it will save someone's life.
This is the command VS executes:
Severity Code Description Project File Line Suppression State
Error MSB3073 The command ""C:\Users\Admin\.nuget\packages\nswag.msbuild\13.0.5\build\../tools/Win/NSwag.exe" openapi2csclient /className:Api /namespace:WebRef.AccessPay /input:C:\Code\WebApplication1\WebApplication1\OpenAPIs\swagger.json /output:obj\swaggerClient.cs " exited with code -1. WebApplication1 C:\Users\Admin\.nuget\packages\nswag.apidescription.client\13.0.5\build\NSwag.ApiDescription.Client.targets 28
Hello, i had the same problem on this version. I updated to the latest version of nswag to resolve my issue.
For OpenAPI 3 definition you will need this version https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.20/swagger-codegen-cli-3.0.20.jar
But the same can be easily done via https://editor.swagger.io/ using this menu
@fairking check this issue if it is not the same. https://github.com/RicoSuter/NSwag/issues/3126#issuecomment-1345612679