Skip to content

Commit 0141824

Browse files
Merge pull request #1160 from christianhelle/version-links-in-docs
Add links to other versions of the extension on the Marketplace
2 parents 8a2dd47 + 396482b commit 0141824

File tree

4 files changed

+103
-33
lines changed

4 files changed

+103
-33
lines changed

docs/Marketplace.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[![buymeacoffee](https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg)](https://www.buymeacoffee.com/christianhelle)
22

3-
There is a separate VSIX installer available for **[Visual Studio 2022](https://marketplace.visualstudio.com/items?itemName=ChristianResmaHelle.ApiClientCodeGenerator2022)** and **[Visual Studio 2017](https://marketplace.visualstudio.com/items?itemName=ChristianResmaHelle.ApiClientCodeGenerator2017)**
3+
There is a separate VSIX installer available for **[Visual Studio 2022](https://marketplace.visualstudio.com/items?itemName=ChristianResmaHelle.ApiClientCodeGenerator2022)**, **[Visual Studio 2017](https://marketplace.visualstudio.com/items?itemName=ChristianResmaHelle.ApiClientCodeGenerator2017)**, and **[Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ChristianResmaHelle.rest-api-client-code-generator)**
44

55
# REST API Client Code Generator
66

docs/Marketplace2022.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[![buymeacoffee](https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg)](https://www.buymeacoffee.com/christianhelle)
22

3-
There is a separate VSIX installer available for **[Visual Studio 2019](https://marketplace.visualstudio.com/items?itemName=ChristianResmaHelle.APIClientCodeGenerator)** and **[Visual Studio 2017](https://marketplace.visualstudio.com/items?itemName=ChristianResmaHelle.ApiClientCodeGenerator2017)**
3+
There is a separate VSIX installer available for **[Visual Studio 2019](https://marketplace.visualstudio.com/items?itemName=ChristianResmaHelle.APIClientCodeGenerator)**, **[Visual Studio 2017](https://marketplace.visualstudio.com/items?itemName=ChristianResmaHelle.ApiClientCodeGenerator2017)**, and **[Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ChristianResmaHelle.rest-api-client-code-generator)**
44

55
# REST API Client Code Generator
66

docs/VSCode.md

Lines changed: 97 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,122 @@
1-
This VS Code extension is a cross-platform alternative to the Visual Studio extension for generating C# REST API clients from OpenAPI/Swagger specifications.
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+
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.
231

332
## Features
433

5-
- Generate C# REST API clients from OpenAPI/Swagger JSON or YAML files
6-
- Context menu integration on JSON and YAML files in the VS Code explorer
7-
- Support for all code generators:
8-
- NSwag
9-
- Refitter
10-
- OpenAPI Generator
11-
- Microsoft Kiota
12-
- Swagger Codegen CLI
13-
- AutoREST
14-
- Configuration options for namespace and output directory
15-
- 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
1657

1758
## Screenshot
1859

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

21-
![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)
2263

23-
![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)
2465

2566
## Requirements
2667

27-
- .NET 6.0 SDK or higher
68+
### For C# code generation
69+
70+
- .NET SDK 6.0 or higher
2871
- Java Runtime Environment (for OpenAPI Generator and Swagger Codegen CLI)
2972
- NPM (for AutoREST and NSwag)
3073

74+
### For TypeScript code generation
75+
76+
- Node.js and NPM
77+
- OpenAPI Generator
78+
3179
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.
3280

33-
## 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
3489

3590
1. Right-click on a Swagger/OpenAPI specification file (JSON or YAML) in the VS Code explorer
36-
2. Select "REST API Client Code Generator" in the context menu
37-
3. Choose one of the available code generators
38-
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
3995

40-
## Extension Settings
96+
## Dependencies
4197

42-
This extension contributes the following settings:
98+
### C# Dependencies
4399

44-
* `restApiClientCodeGenerator.namespace`: Default namespace to use in generated code (default: "GeneratedCode")
45-
* `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:
46101

47-
## 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
48108

49-
You can install this extension in several ways:
109+
### TypeScript Dependencies
50110

51-
1. Download the VSIX from [GitHub Releases](https://github.com/christianhelle/apiclientcodegen/releases)
52-
2. Install from VSIX in VS Code:
53-
- Go to Extensions view (Ctrl+Shift+X)
54-
- Click "..." menu in the top right corner
55-
- Select "Install from VSIX..."
56-
- 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)