RicoSuter / NSwag

The Swagger/OpenAPI toolchain for .NET, ASP.NET Core and TypeScript.
http://NSwag.org
MIT License
6.62k stars 1.23k forks source link

The path is empty #4789

Open Mortana89 opened 4 months ago

Mortana89 commented 4 months ago

Executing following command on a .NET Core 8 project: nswag aspnetcore2openapi /documentName:v1 /output:swagger.json

This throws me: NSwag bin directory: C:\Users\s.dotnet\tools.store\nswag.consolecore\14.0.3\nswag.consolecore\14.0.3\tools\net8.0\any System.ArgumentException: The path is empty. (Parameter 'path') at System.IO.Path.GetFullPath(String path) at NSwag.Commands.Generation.AspNetCore.ProjectMetadata.GetProjectMetadata(String file, String buildExtensionsDir, String framework, String configuration, String runtime, Boolean noBuild, String outputPath, IConsoleHost console) in //src/NSwag.Commands/Commands/Generation/AspNetCore/ProjectMetadata.cs:line 113 at NSwag.Commands.Generation.AspNetCore.AspNetCoreToOpenApiCommand.RunAsync(CommandLineProcessor processor, IConsoleHost host) in //src/NSwag.Commands/Commands/Generation/AspNetCore/AspNetCoreToOpenApiCommand.cs:line 70 at NConsole.CommandLineProcessor.ProcessSingleAsync(String[] args, Object input) at NConsole.CommandLineProcessor.ProcessAsync(String[] args, Object input) at NSwag.Commands.NSwagCommandProcessor.ProcessAsync(String[] args) in /_/src/NSwag.Commands/NSwagCommandProcessor.cs:line 62

My goal: I am able to serve multiple swagger.jsons based on API versions, however, I'm unable to generate these from the CLI. I want these to generate from CLI commands so I can put it in our CI pipeline, and then push to Azure APIM.

metalic-skeleton commented 2 months ago

Any update or Work around of this issue?