Skip to content

Commit 396482b

Browse files
Update README files to enhance installation instructions and add context for VSIX installers
1 parent 7e790de commit 396482b

File tree

2 files changed

+97
-31
lines changed

2 files changed

+97
-31
lines changed

docs/VSCode.md

Lines changed: 93 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,59 +2,121 @@
22

33
There is a separate VSIX installer available for **[Visual Studio 2022](https://marketplace.visualstudio.com/items?itemName=ChristianResmaHelle.ApiClientCodeGenerator2022)**, **[Visual Studio 2019](https://marketplace.visualstudio.com/items?itemName=ChristianResmaHelle.APIClientCodeGenerator)** and **[Visual Studio 2017](https://marketplace.visualstudio.com/items?itemName=ChristianResmaHelle.ApiClientCodeGenerator2017)**
44

5-
This VS Code extension is a cross-platform alternative to the Visual Studio extension for generating C# REST API clients from OpenAPI/Swagger specifications.
5+
# REST API Client Code Generator
6+
7+
A VS Code extension for generating C# and TypeScript REST API clients from OpenAPI/Swagger specifications.
8+
9+
## Installation
10+
11+
You can install this extension in several ways:
12+
13+
1. **VS Code Marketplace**: Search for "REST API Client Code Generator" in the VS Code Extensions view.
14+
15+
2. **Manual Installation**:
16+
- Download the `.vsix` file from the [GitHub releases page](https://github.com/christianhelle/apiclientcodegen/releases)
17+
- In VS Code, go to Extensions view
18+
- Click on "..." menu in the top right corner
19+
- Select "Install from VSIX..."
20+
- Locate and select the downloaded `.vsix` file
21+
22+
3. **Build from Source**:
23+
24+
```powershell
25+
git clone https://github.com/christianhelle/apiclientcodegen.git
26+
cd apiclientcodegen
27+
./src/build-vscode.ps1
28+
```
29+
30+
Then install the generated `.vsix` file using the method above.
631

732
## Features
833

9-
- Generate C# REST API clients from OpenAPI/Swagger JSON or YAML files
10-
- Context menu integration on JSON and YAML files in the VS Code explorer
11-
- Support for all code generators:
12-
- NSwag
13-
- Refitter
14-
- OpenAPI Generator
15-
- Microsoft Kiota
16-
- Swagger Codegen CLI
17-
- AutoREST
18-
- Configuration options for namespace and output directory
19-
- Cross-platform support (Windows, macOS, Linux)
34+
This extension adds a context menu item **REST API Client Code Generator** when right-clicking on JSON or YAML files in the VS Code explorer. The context menu provides the following code generation options:
35+
36+
### C# Generators
37+
38+
- **NSwag**: Generates a C# REST API Client using NSwag
39+
- **Refitter**: Generates a C# Refit interface using Refitter
40+
- **OpenAPI Generator**: Generates a C# REST API Client using OpenAPI Generator
41+
- **Microsoft Kiota**: Generates a C# REST API Client using Microsoft Kiota
42+
- **Swagger Codegen CLI**: Generates a C# REST API Client using Swagger Codegen CLI
43+
- **AutoREST**: Generates a C# REST API Client using AutoREST
44+
45+
### TypeScript Generators
46+
47+
- **Angular**: Generates a TypeScript REST API Client for Angular
48+
- **Aurelia**: Generates a TypeScript REST API Client for Aurelia
49+
- **Axios**: Generates a TypeScript REST API Client for Axios
50+
- **Fetch**: Generates a TypeScript REST API Client for Fetch
51+
- **Inversify**: Generates a TypeScript REST API Client for Inversify
52+
- **jQuery**: Generates a TypeScript REST API Client for jQuery
53+
- **NestJS**: Generates a TypeScript REST API Client for NestJS
54+
- **Node**: Generates a TypeScript REST API Client for Node
55+
- **Redux Query**: Generates a TypeScript REST API Client for Redux Query
56+
- **RxJS**: Generates a TypeScript REST API Client for RxJS
2057

2158
## Screenshot
2259

2360
![Command Palette](https://github.com/christianhelle/apiclientcodegen/raw/master/images/vscode-command-palette.png)
2461

25-
![C#](https://github.com/christianhelle/apiclientcodegen/raw/master/images/vscode-context-menu.png)
62+
![C# Context Menu](https://github.com/christianhelle/apiclientcodegen/raw/master/images/vscode-context-menu.png)
2663

27-
![TypeScript](https://github.com/christianhelle/apiclientcodegen/raw/master/images/vscode-context-menu-typescript.png)
64+
![TypeScript Context Menu](https://github.com/christianhelle/apiclientcodegen/raw/master/images/vscode-context-menu-typescript.png)
2865

2966
## Requirements
3067

31-
- .NET 6.0 SDK or higher
68+
### For C# code generation
69+
70+
- .NET SDK 6.0 or higher
3271
- Java Runtime Environment (for OpenAPI Generator and Swagger Codegen CLI)
3372
- NPM (for AutoREST and NSwag)
3473

74+
### For TypeScript code generation
75+
76+
- Node.js and NPM
77+
- OpenAPI Generator
78+
3579
The extension uses the `rapicgen` .NET tool to generate the code. If not already installed, you will be prompted to install it when first attempting to generate code.
3680

37-
## Usage
81+
## Settings and Configuration
82+
83+
The extension includes configurable settings:
84+
85+
- `restApiClientCodeGenerator.namespace`: Default namespace to use in generated code (default: "GeneratedCode")
86+
- `restApiClientCodeGenerator.outputDirectory`: Output directory relative to workspace folder (default: same directory as the specification file)
87+
88+
## How to Use
3889

3990
1. Right-click on a Swagger/OpenAPI specification file (JSON or YAML) in the VS Code explorer
40-
2. Select "REST API Client Code Generator" in the context menu
41-
3. Choose one of the available code generators
42-
4. The generated C# code will be opened in the editor
91+
2. Select "REST API Client Generator" in the context menu
92+
3. Choose your desired language (C# or TypeScript)
93+
4. Select one of the available generators for that language
94+
5. The generated code will be saved in the configured output directory and opened in the editor
4395

44-
## Extension Settings
96+
## Dependencies
4597

46-
This extension contributes the following settings:
98+
### C# Dependencies
4799

48-
* `restApiClientCodeGenerator.namespace`: Default namespace to use in generated code (default: "GeneratedCode")
49-
* `restApiClientCodeGenerator.outputDirectory`: Output directory relative to workspace folder (default: same directory as the specification file)
100+
The C# code generated by each generator depends on different NuGet packages:
50101

51-
## Installation
102+
- **NSwag**: Depends on Newtonsoft.Json
103+
- **Refitter**: Depends on Refit
104+
- **OpenAPI Generator**: Depends on RestSharp, JsonSubTypes, Polly, Newtonsoft.Json
105+
- **Microsoft Kiota**: Depends on Microsoft.Kiota.* packages and Azure.Identity
106+
- **Swagger Codegen CLI**: Depends on RestSharp and JsonSubTypes
107+
- **AutoREST**: Depends on Microsoft.Rest.ClientRuntime and Newtonsoft.Json
52108

53-
You can install this extension in several ways:
109+
### TypeScript Dependencies
54110

55-
1. Download the VSIX from [GitHub Releases](https://github.com/christianhelle/apiclientcodegen/releases)
56-
2. Install from VSIX in VS Code:
57-
- Go to Extensions view (Ctrl+Shift+X)
58-
- Click "..." menu in the top right corner
59-
- Select "Install from VSIX..."
60-
- Select the downloaded .vsix file
111+
The TypeScript code generated depends on the framework chosen:
112+
113+
- **Angular**: Depends on @angular/core, rxjs
114+
- **Axios**: Depends on axios
115+
- **Fetch**: Uses the browser's native fetch API
116+
- **jQuery**: Depends on jquery
117+
- **RxJS**: Depends on rxjs
118+
- For other frameworks, please refer to their official documentation or the [OpenAPI Generator documentation](https://openapi-generator.tech/docs/generators) for detailed dependency information.
119+
120+
## Related
121+
122+
- This extension is the VS Code equivalent of the [REST API Client Code Generator](https://marketplace.visualstudio.com/items?itemName=ChristianResmaHelle.APIClientCodeGenerator2022) extension for Visual Studio.

src/VSCode/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
[![buymeacoffee](https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg)](https://www.buymeacoffee.com/christianhelle)
2+
3+
There is a separate VSIX installer available for **[Visual Studio 2022](https://marketplace.visualstudio.com/items?itemName=ChristianResmaHelle.ApiClientCodeGenerator2022)**, **[Visual Studio 2019](https://marketplace.visualstudio.com/items?itemName=ChristianResmaHelle.APIClientCodeGenerator)** and **[Visual Studio 2017](https://marketplace.visualstudio.com/items?itemName=ChristianResmaHelle.ApiClientCodeGenerator2017)**
4+
15
# REST API Client Code Generator
26

37
A VS Code extension for generating C# and TypeScript REST API clients from OpenAPI/Swagger specifications.

0 commit comments

Comments
 (0)