You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then install the generated `.vsix` file using the method above.
25
27
26
28
## Features
27
29
28
30
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:
29
31
32
+
### C# Generators
33
+
30
34
-**NSwag**: Generates a C# REST API Client using NSwag
31
35
-**Refitter**: Generates a C# Refit interface using Refitter
32
36
-**OpenAPI Generator**: Generates a C# REST API Client using OpenAPI Generator
33
37
-**Microsoft Kiota**: Generates a C# REST API Client using Microsoft Kiota
34
38
-**Swagger Codegen CLI**: Generates a C# REST API Client using Swagger Codegen CLI
35
39
-**AutoREST**: Generates a C# REST API Client using AutoREST
36
40
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
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.
52
76
53
-
## Extension Settings
77
+
## Settings and Configuration
54
78
55
-
This extension contributes the following settings:
79
+
The extension includes configurable settings:
56
80
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)
59
83
60
84
## How to Use
61
85
62
86
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
66
91
67
92
## Dependencies
68
93
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:
70
97
71
98
-**NSwag**: Depends on Newtonsoft.Json
72
99
-**Refitter**: Depends on Refit
@@ -75,6 +102,17 @@ The code generated by each generator depends on different NuGet packages:
75
102
-**Swagger Codegen CLI**: Depends on RestSharp and JsonSubTypes
76
103
-**AutoREST**: Depends on Microsoft.Rest.ClientRuntime and Newtonsoft.Json
77
104
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
+
78
116
## Related
79
117
80
118
- 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