christianhelle / apiclientcodegen

A collection of Visual Studio custom tool code generators for Swagger / OpenAPI specification files
http://bit.ly/restapicodegen
GNU General Public License v3.0
176 stars 22 forks source link

Generate with Kiota doesn't work on Visual Studio for Mac when using ZSH as default shell #497

Closed christianhelle closed 3 months ago

christianhelle commented 1 year ago

Describe the bug Generate with Kiota context menu doesn't work on Visual Studio for Mac 2022 when using ZSH as the default shell

To Reproduce Steps to reproduce the behavior:

  1. Right click a project file, select Add -> New REST API Client -> Generate with Kiota
  2. Insert URL to Swagger Petstore v3 OpenAPI spec
  3. Wait for NuGet packages to be installed after a couple of project reloads

Expected behavior A code behind file is generated for the newly added OpenAPI spec file

Screenshots If applicable, add screenshots to help explain your problem.

Visual Studio Extension (please complete the following information):

Additional context Add any other context about the problem here.

The tool outputs the following

Executing:
dotnet tool install --global Microsoft.OpenApi.Kiota --version 1.0.1
Tools directory '/Users/christian/.dotnet/tools' is not currently on the PATH environment variable.
If you are using zsh, you can add it to your profile by running the following command:

cat << \EOF >> ~/.zprofile
# Add .NET Core SDK tools
export PATH="$PATH:/Users/christian/.dotnet/tools"
EOF

And run `zsh -l` to make it available for current session.

You can only add it to the current session by running the following command:

export PATH="$PATH:/Users/christian/.dotnet/tools"

You can invoke the tool using the following command: kiota
Tool 'microsoft.openapi.kiota' (version '1.0.1') was successfully installed.

PROGRESS: 30%

PROGRESS: 40%
Executing:
kiota  generate -l CSharp -d ./Swagger.json -o /var/folders/6f/sxylb9b11ln1f9cbcyc6r9jh0000gn/T/fde34d26-ea98-449a-893e-fc93c31d47fb -n GeneratedCode
Error: An error occurred trying to start process 'kiota' with working directory '/Users/christian/projects/testapp'. No such file or directory
christianhelle commented 3 months ago

Visual Studio for Mac is a dying product and this is no longer relevant