How to generate C# or TypeScript client code for OpenAPI (Swagger) specification

All steps of generation process in Visual Studio Community 2019 v16.1.3 with default options (without customization of code generation)

Step 1. Install the Connected Service

“Extensions and Updates…” menu item in Visual Studio Community 2017 v15.9.12
“Manage Extensions” menu item in Visual Studio Community 2019 v16.1.3
Install Unchase OpenAPI (Swagger) Connected Service in Visual Studio

Step 2. Open the Connected Service wizard for Visual Studio project

“Connected Services” item in the project in Solution Explorer
“Dependencies” item in the project in Solution Explorer
Choose the Unchase OpenAPI (Swagger) Connected Service
“Unchase OpenAPI (Swagger) Connected Service” wizard

Step 3. Configure OpenAPI specification endpoint

Configure OpenAPI (Swagger) specification endpoint in the first page of the wizard
NSwagStudio “Runtime” and “Default Variables” options
NSwagStudio “Create local Copy” button
Specify “Network credentials” and “Web Proxy with credentials” to access the specification file

Step 4 (Optional). Configure code generation options

All steps of generation process in Visual Studio Community 2019 v16.1.3 with customization of C# client code generation

--

--

--

Security researcher, developer. Mostly working with “Centurion” and Visual Studio Extensions. https://github.com/unchase

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Real-time Business Data | Free Domain Categorization API

Prometheus + Grafana +Kubernates and Continuous Monitoring & Improvement

Project’s mechanics

What it takes to get a job at Twitter

Elixir e Reinforcement Learning — II

Comet’s Year-in-Review: 2021

We are accustomed _____ doing hard work.

October 2021 Distribution Report

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Nikolay Chebotov

Nikolay Chebotov

Security researcher, developer. Mostly working with “Centurion” and Visual Studio Extensions. https://github.com/unchase

More from Medium

Deep dive into Array.prototype.sort()

Stop using ANY in typescript

Interfaces In TypeScript

Automation and Continuous Integration using with Bitbucket CI/CD Pipelines