Skip to content

Commit 5aa3768

Browse files
Enhance VSCode README to include Refitter settings support and usage instructions
1 parent f0a9a62 commit 5aa3768

File tree

1 file changed

+42
-1
lines changed

1 file changed

+42
-1
lines changed

src/VSCode/README.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ You can install this extension in several ways:
2121

2222
## Features
2323

24-
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:
24+
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. Additionally, it provides a **Generate Refitter Output** command when right-clicking on `.refitter` settings files. The context menu provides the following code generation options:
2525

2626
### C# Generators
2727

@@ -45,6 +45,10 @@ This extension adds a context menu item **REST API Client Code Generator** when
4545
- **Redux Query**: Generates a TypeScript REST API Client for Redux Query
4646
- **RxJS**: Generates a TypeScript REST API Client for RxJS
4747

48+
### Refitter Settings Support
49+
50+
- **Generate Refitter Output**: When right-clicking on a `.refitter` settings file, you can generate C# Refit interfaces using Refitter with custom configuration. This allows for advanced Refitter configurations including custom settings for authentication, serialization, and other Refitter-specific options.
51+
4852
## Screenshot
4953

5054
![Command Palette](https://github.com/christianhelle/apiclientcodegen/raw/master/images/vscode-command-palette.png)
@@ -77,12 +81,49 @@ The extension includes configurable settings:
7781

7882
## How to Use
7983

84+
### For OpenAPI/Swagger Specifications
85+
8086
1. Right-click on a Swagger/OpenAPI specification file (JSON or YAML) in the VS Code explorer
8187
2. Select "REST API Client Generator" in the context menu
8288
3. Choose your desired language (C# or TypeScript)
8389
4. Select one of the available generators for that language
8490
5. The generated code will be saved in the configured output directory and opened in the editor
8591

92+
### For Refitter Settings Files
93+
94+
1. Create a `.refitter` settings file with your Refitter configuration
95+
2. Right-click on the `.refitter` file in the VS Code explorer
96+
3. Select "Generate Refitter Output" from the context menu
97+
4. The generated C# Refit interfaces will be created according to your settings file configuration
98+
99+
## Refitter Settings Files
100+
101+
The extension supports Refitter settings files (`.refitter`) which allow you to configure advanced options for generating C# Refit interfaces. A typical `.refitter` settings file includes:
102+
103+
- **OpenAPI specification URL or file path**
104+
- **Namespace configuration**
105+
- **Output file paths**
106+
- **Authentication settings**
107+
- **Serialization options**
108+
- **Custom type mappings**
109+
- **And many other Refitter-specific options**
110+
111+
Example `.refitter` file:
112+
113+
```json
114+
{
115+
"openApiSpecUrl": "https://petstore.swagger.io/v2/swagger.json",
116+
"namespace": "PetStore.Api",
117+
"outputFolder": "./Generated",
118+
"outputFilename": "PetStoreApi.cs",
119+
"clientName": "PetStoreClient",
120+
"generateContracts": true,
121+
"generateXmlDocCodeComments": true
122+
}
123+
```
124+
125+
For more information about Refitter settings, visit the [Refitter documentation](https://github.com/christianhelle/refitter).
126+
86127
## Dependencies
87128

88129
### C# Dependencies

0 commit comments

Comments
 (0)