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
177 stars 23 forks source link

VS 2022, Unrecognized command or argument '--type-access-modifier' 'public. #1016

Closed HarminderArtesianIo closed 1 week ago

HarminderArtesianIo commented 1 week ago

Type Access modifier for Generated Types "Public" is not working I was able to generate the Api client earlier without any issues with VS2022 and extension REST API Client Code Generator . But now after upgrading the Rest API Client Tool in Vs2022.

Support Key: 29fd6a4 Found in Tools -> Options -> REST API Client Code Generator - Analytics

To Reproduce Steps to reproduce the behavior:

  1. Right click C# project in Vs2022
  2. Add > New Rest Api client > Generate with Microsoft Kiota (v.1.19.0)
  3. Paste path of my Swagger file http://localhost:5000/swagger/v1/swagger.json
  4. Click OK
  5. Swagger file is added to my project
  6. But the swagger.cs file is not getting generated. It is giving me error.

Error: Unrecognized command or argument '--type-access-modifier'. Unrecognized command or argument 'Public'.

When i changed Type access modifier to protected. Error changed to

Unrecognized command or argument '--type-access-modifier'. Unrecognized command or argument 'protected'.

Vs 2022, screenshot for your reference is attached here:

image
christianhelle commented 1 week ago

@HarminderArtesianIo Thanks for taking the time to report this

The --type-access-modifier argument was introduced in Kiota v1.19.0.

Do you have an older version of Kiota installed?

Try to update Kiota manually by running

dotnet tool update --global microsoft.openapi.kiota

on the terminal

HarminderArtesianIo commented 1 week ago

@christianhelle This is resolved. Thank you for your prompt reply and resolution.

I was busy with a personal thing at home , I apologize for late reply.

christianhelle commented 1 week ago

@HarminderArtesianIo I'm glad to hear that it works now

christianhelle commented 1 week ago

I would be very grateful for a rating or review on the Visual Studio Marketplace