REST Client extension (recommended but not required)
Usage
You can use HTTP File Generator in two ways:
Right-click on an OpenAPI specification file (.json, .yaml, or .yml) in the VS Code Explorer and select "HTTP File Generator" from the context menu
Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P) and search for "HTTP File Generator"
Choose either:
"Generate single HTTP file"
"Generate multiple HTTP files (one request per file)"
If running from the Command Palette, you'll be prompted to select an OpenAPI file from your workspace.
If the httpgenerator .NET tool is not installed, you'll be prompted to install it.
You'll be prompted to select an output folder. By default, it will suggest creating a "HttpFiles" subfolder in the same directory as your input file, but you can choose any location.
About HTTP Files
.http files were made popular by the Visual Studio Code extension REST Client, which was later adopted by JetBrains IDEs and Visual Studio 2022.
Related Projects
This extension is a VS Code wrapper around the httpgenerator .NET Tool.