Apiclientcodegen
A collection of Visual Studio code generators for Swagger / OpenAPI specification files
Install / Use
/learn @christianhelle/ApiclientcodegenREADME
REST API Client Code Generator
A collection of Visual Studio C# custom tool code generators for Swagger / OpenAPI specification files
Download
- Visual Studio 2026 (Out-of-Process Model)
- Visual Studio 2022
- Visual Studio 2019
- Visual Studio 2017
- Visual Studio Code
- Visual Studio for Mac
- JetBrains Rider
Features
- Supports Visual Studio 2017, 2019, 2022, 2026, Visual Studio Code, Visual Studio for Mac, and JetBrains Rider
- Add New REST API Client to a project from an OpenAPI specification URL (e.g https://petstore.swagger.io/v2/swagger.json) using the following code generators:
- NSwag
- OpenAPI Generator
- Swagger Codegen
- Refitter
- Microsoft Kiota
- AutoRest ⚠️ Deprecated - See AutoRest Migration Guide
- Define custom namespace for the generated file
- Auto-updating of generated code file when changes are made to the OpenAPI specification JSON or YAML file
- Generate code using a configuration files using the following:
.nswagconfiguration files from NSwagStudio by including it in the project and using the Generate NSwag Studio output context menu.refittersettings files from Refitter by including it in the project and using the Generate Refitter output context menukiota-lock.jsonconfiguration files from Microsoft Kiota by including it in the project and using the Generate Kiota output context menu
Custom Tools
Custom tools let you associate a tool with an item in a project and run that tool whenever the file is saved
-
NSwagCodeGenerator - Generates a single file C# REST API Client using the NSwag.CodeGeneration.CSharp nuget package v14.6.3
-
OpenApiCodeGenerator - Generates a single file C# REST API Client using OpenAPI Generator v7.21.0. The output file is the result of merging all the files generated using the OpenAPI Generator tool with:
generate -g csharp --input-spec [swagger file] --output [output file] -DapiTests=false -DmodelTests=false -DpackageName=[default namespace] --skip-overwrite. It is possible to configure the OpenAPI Generator to generate multiple files which will be placed at the same path as the OpenAPI specifications document that was used to generate code, this is done under Tools -> REST API Client Code Generator -> OpenAPI Generator and setting Generate Multiple Files to true -
KiotaCodeGenerator - Generates a single file C# REST API Client using the Microsoft project Kiota v1.30.0 generator. The output file is the result of merging all the files generated using the Kiota dotnet tool with:
generate -l CSharp -d [swagger file] -o [output file] -n [default namespace]. It is possible to configure the OpenAPI Generator to generate multiple files which will be placed at the same path as the OpenAPI specifications document that was used to generate code, this is done under Tools -> REST API Client Code Generator -> Kiota and setting Generate Multiple Files to true -
SwaggerCodeGenerator - Generates a single file C# REST API Client using Swagger Codegen CLI v3.0.34. The output file is the result of merging all the files generated using the Swagger Codegen CLI tool with:
generate -l csharp --input-spec [swagger file] --output [output file] -DapiTests=false -DmodelTests=false -DpackageName=[default namespace] --skip-overwrite -
AutoRestCodeGenerator - ⚠️ Deprecated - Generates a single file C# REST API Client using AutoRest v3.0.0-beta.20210504.2 for OpenAPI v3 and AutoRest v2.0.4417 for OpenAPI v2. AutoRest is deprecated by Microsoft and will be retired on July 1, 2026. See the AutoRest Migration Guide for alternatives. The resulting file is the equivalent of using the AutoRest CLI tool with:
--csharp --input-file=[swagger file] --output-file=[output file] --namespace=[default namespace] --add-credentials -
RefitterCodeGenerator - Generates a single file C# REST API Client interface for Refit using Refitter.Core nuget package v1.7.3. The output file contains a Refit interface generated by Refitter and contracts generated using NSwag.CodeGeneration.CSharp nuget package
Dependencies
The custom tool code generators piggy back on top of well known Open API client code generators like NSwag, OpenAPI Generator, Microsoft Kiota, Refitter, Swagger Codegen CLI, and AutoRest (deprecated). These tools require .NET SDK, NPM and the Java Runtime Environment to be installed on the developers machine. Alternative Java SDK implementations such as the OpenJDK works fine with this extension. By default, the path to java.exe is read from the JAVA_HOME environment variable, but is also configurable in the Settings screen. Future versions of the e
Related Skills
ai-cmo
Collection of my Agent Skills and books.
next
A beautifully designed, floating Pomodoro timer that respects your workspace.
product-manager-skills
38PM skill for Claude Code, Codex, Cursor, and Windsurf: diagnose SaaS metrics, critique PRDs, plan roadmaps, run discovery, and coach PM career transitions.
devplan-mcp-server
3MCP server for generating development plans, project roadmaps, and task breakdowns for Claude Code. Turn project ideas into paint-by-numbers implementation plans.
