HTTP File Generator generates .http files from OpenAPI specifications.
.http files were made popular by the Visual Studio Code extension REST Client, which then was adopted by JetBrains IDEs, and later on Visual Studio 2022.
The CLI accepts a URL or input file for an OpenAPI specification and writes ready-to-run .http files to disk. It can generate one request per file, one file per tag, or a single combined file. Generated requests can include content type variables, path parameter variables, request summaries, descriptions, sample payloads, and custom headers.
Generate .http files from OpenAPI specifications
Usage: httpgenerator [URL or input file] [OPTIONS]
Arguments:
[URL or input file] URL or file path to OpenAPI Specification file
Options:
-o, --output <OUTPUT>
Output directory [default: ./]
--no-logging
Don't log errors or collect telemetry
--skip-validation
Skip validation of OpenAPI Specification file
--authorization-header <HEADER>
Authorization header to use for all requests
--load-authorization-header-from-environment
Load the authorization header from an environment variable or define it in the .http file. You can use --authorization-header-variable-name to specify the environment variable name.
--authorization-header-variable-name <VARIABLE-NAME>
Name of the environment variable to load the authorization header from [default: authorization]
--content-type <CONTENT-TYPE>
Default Content-Type header to use for all requests [default: application/json]
--base-url <BASE-URL>
Default Base URL to use for all requests. Use this if the OpenAPI spec doesn't explicitly specify a server URL.
--output-type <OUTPUT-TYPE>
OneRequestPerFile generates one .http file per request. OneFile generates a single .http file for all requests. OneFilePerTag generates one .http file per first tag associated with each request. [default: OneRequestPerFile] [possible values: OneRequestPerFile, OneFile, OneFilePerTag]
--azure-scope <SCOPE>
Azure Entra ID Scope to use for retrieving Access Token for Authorization header
--azure-tenant-id <TENANT-ID>
Azure Entra ID Tenant ID to use for retrieving Access Token for Authorization header
--timeout <SECONDS>
Timeout (in seconds) for writing files to disk [default: 120]
--generate-intellij-tests
Generate IntelliJ tests that assert whether the response status code is 200
--custom-header <HEADER>
Add custom HTTP headers to the generated request
--skip-headers
Don't generate header parameters in the files
-h, --help
Print help information
-v, --version
Print version information
Examples:
httpgenerator ./openapi.json
httpgenerator ./openapi.json --output ./
httpgenerator ./openapi.json --output-type onefile
httpgenerator https://petstore.swagger.io/v2/swagger.json
httpgenerator https://petstore3.swagger.io/api/v3/openapi.json --base-url https://petstore3.swagger.io
httpgenerator ./openapi.json --authorization-header Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9c
httpgenerator ./openapi.json --azure-scope [Some Application ID URI]/.default
httpgenerator ./openapi.json --generate-intellij-tests
httpgenerator ./openapi.json --custom-header X-Custom-Header: Value --custom-header X-Another-Header: AnotherValue
You are about to open
Do you wish to proceed?
Thank you for your report. Information you provided will help us investigate further.
There was an error while sending your report. Please try again later.
Snaps are applications packaged with all their dependencies to run on all popular Linux distributions from a single build. They update automatically and roll back gracefully.
Snaps are discoverable and installable from the Snap Store, an app store with an audience of millions.
Snap is available for CentOS 7.6+, and Red Hat Enterprise Linux 7.6+, from the Extra Packages for Enterprise Linux (EPEL) repository. The EPEL repository can be added to your system with the following command:
sudo yum install epel-release
Snap can now be installed as follows:
sudo yum install snapd
Once installed, the systemd unit that manages the main snap communication socket needs to be enabled:
sudo systemctl enable --now snapd.socket
To enable classic snap support, enter the following to create a symbolic link between /var/lib/snapd/snap and /snap:
sudo ln -s /var/lib/snapd/snap /snap
Either log out and back in again, or restart your system, to ensure snap’s paths are updated correctly.
To install HTTP File Generator, simply use the following command:
sudo snap install httpgenerator
Browse and find snaps from the convenience of your desktop using the snap store snap.
Interested to find out more about snaps? Want to publish your own application? Visit snapcraft.io now.