Skip to content

Commit ae5d1e5

Browse files
Merge pull request #1155 from christianhelle/vscode-docs-typescript
Update VS Code docs
2 parents 6184d32 + 8731899 commit ae5d1e5

File tree

1 file changed

+49
-11
lines changed

1 file changed

+49
-11
lines changed

src/VSCode/README.md

Lines changed: 49 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# REST API Client Code Generator
22

3-
A VS Code extension for generating C# REST API clients from OpenAPI/Swagger specifications.
3+
A VS Code extension for generating C# and TypeScript REST API clients from OpenAPI/Swagger specifications.
44

55
## Installation
66

@@ -16,57 +16,84 @@ You can install this extension in several ways:
1616
- Locate and select the downloaded `.vsix` file
1717

1818
3. **Build from Source**:
19+
1920
```powershell
2021
git clone https://github.com/christianhelle/apiclientcodegen.git
2122
cd apiclientcodegen
2223
./src/build-vscode.ps1
2324
```
25+
2426
Then install the generated `.vsix` file using the method above.
2527

2628
## Features
2729

2830
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:
2931

32+
### C# Generators
33+
3034
- **NSwag**: Generates a C# REST API Client using NSwag
3135
- **Refitter**: Generates a C# Refit interface using Refitter
3236
- **OpenAPI Generator**: Generates a C# REST API Client using OpenAPI Generator
3337
- **Microsoft Kiota**: Generates a C# REST API Client using Microsoft Kiota
3438
- **Swagger Codegen CLI**: Generates a C# REST API Client using Swagger Codegen CLI
3539
- **AutoREST**: Generates a C# REST API Client using AutoREST
3640

41+
### TypeScript Generators
42+
43+
- **Angular**: Generates a TypeScript REST API Client for Angular
44+
- **Aurelia**: Generates a TypeScript REST API Client for Aurelia
45+
- **Axios**: Generates a TypeScript REST API Client for Axios
46+
- **Fetch**: Generates a TypeScript REST API Client for Fetch
47+
- **Inversify**: Generates a TypeScript REST API Client for Inversify
48+
- **jQuery**: Generates a TypeScript REST API Client for jQuery
49+
- **NestJS**: Generates a TypeScript REST API Client for NestJS
50+
- **Node**: Generates a TypeScript REST API Client for Node
51+
- **Redux Query**: Generates a TypeScript REST API Client for Redux Query
52+
- **RxJS**: Generates a TypeScript REST API Client for RxJS
53+
3754
## Screenshot
3855

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

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

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

4562
## Requirements
4663

64+
### For C# code generation
65+
4766
- .NET SDK 6.0 or higher
4867
- Java Runtime Environment (for OpenAPI Generator and Swagger Codegen CLI)
4968
- NPM (for AutoREST and NSwag)
5069

70+
### For TypeScript code generation
71+
72+
- Node.js and NPM
73+
- OpenAPI Generator
74+
5175
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.
5276

53-
## Extension Settings
77+
## Settings and Configuration
5478

55-
This extension contributes the following settings:
79+
The extension includes configurable settings:
5680

57-
* `restApiClientCodeGenerator.namespace`: Default namespace to use in generated code (default: "GeneratedCode")
58-
* `restApiClientCodeGenerator.outputDirectory`: Output directory relative to workspace folder (default: same directory as the specification file)
81+
- `restApiClientCodeGenerator.namespace`: Default namespace to use in generated code (default: "GeneratedCode")
82+
- `restApiClientCodeGenerator.outputDirectory`: Output directory relative to workspace folder (default: same directory as the specification file)
5983

6084
## How to Use
6185

6286
1. Right-click on a Swagger/OpenAPI specification file (JSON or YAML) in the VS Code explorer
63-
2. Select "REST API Client Code Generator" in the context menu
64-
3. Choose one of the available code generators
65-
4. The generated C# code will be saved and opened in the editor
87+
2. Select "REST API Client Generator" in the context menu
88+
3. Choose your desired language (C# or TypeScript)
89+
4. Select one of the available generators for that language
90+
5. The generated code will be saved in the configured output directory and opened in the editor
6691

6792
## Dependencies
6893

69-
The code generated by each generator depends on different NuGet packages:
94+
### C# Dependencies
95+
96+
The C# code generated by each generator depends on different NuGet packages:
7097

7198
- **NSwag**: Depends on Newtonsoft.Json
7299
- **Refitter**: Depends on Refit
@@ -75,6 +102,17 @@ The code generated by each generator depends on different NuGet packages:
75102
- **Swagger Codegen CLI**: Depends on RestSharp and JsonSubTypes
76103
- **AutoREST**: Depends on Microsoft.Rest.ClientRuntime and Newtonsoft.Json
77104

105+
### TypeScript Dependencies
106+
107+
The TypeScript code generated depends on the framework chosen:
108+
109+
- **Angular**: Depends on @angular/core, rxjs
110+
- **Axios**: Depends on axios
111+
- **Fetch**: Uses the browser's native fetch API
112+
- **jQuery**: Depends on jquery
113+
- **RxJS**: Depends on rxjs
114+
- For other frameworks, please refer to their official documentation or the [OpenAPI Generator documentation](https://openapi-generator.tech/docs/generators) for detailed dependency information.
115+
78116
## Related
79117

80118
- 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.

0 commit comments

Comments
 (0)