{"id":15091377,"url":"https://github.com/christianhelle/httpgenerator","last_synced_at":"2026-05-11T14:01:49.056Z","repository":{"id":207060389,"uuid":"714590129","full_name":"christianhelle/httpgenerator","owner":"christianhelle","description":"Generate .http files from OpenAPI (Swagger) specifications","archived":false,"fork":false,"pushed_at":"2025-05-13T19:16:01.000Z","size":1166,"stargazers_count":98,"open_issues_count":7,"forks_count":9,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-13T20:41:11.776Z","etag":null,"topics":["openapi","openapi-specification","openapi3","rest-client","swagger"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/christianhelle.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"christianhelle","patreon":null,"open_collective":null,"ko_fi":"christianhelle","tidelift":null,"community_bridge":null,"liberapay":"christianhelle","issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["https://paypal.me/christianhelle","https://buymeacoffee.com/christianhelle"]}},"created_at":"2023-11-05T10:19:39.000Z","updated_at":"2025-05-11T09:25:25.000Z","dependencies_parsed_at":"2024-01-17T01:12:59.088Z","dependency_job_id":"9f4a7232-199b-405d-a4b4-74c9a944aa52","html_url":"https://github.com/christianhelle/httpgenerator","commit_stats":{"total_commits":458,"total_committers":8,"mean_commits":57.25,"dds":0.482532751091703,"last_synced_commit":"c0d48bf2c5f8d447ac2c2ab542beabcdeaa7f0d9"},"previous_names":["christianhelle/httpgenerator"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christianhelle%2Fhttpgenerator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christianhelle%2Fhttpgenerator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christianhelle%2Fhttpgenerator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christianhelle%2Fhttpgenerator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/christianhelle","download_url":"https://codeload.github.com/christianhelle/httpgenerator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254032089,"owners_count":22002871,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["openapi","openapi-specification","openapi3","rest-client","swagger"],"created_at":"2024-09-25T10:40:41.019Z","updated_at":"2026-05-11T14:01:49.036Z","avatar_url":"https://github.com/christianhelle.png","language":"C#","funding_links":["https://github.com/sponsors/christianhelle","https://ko-fi.com/christianhelle","https://liberapay.com/christianhelle","https://paypal.me/christianhelle","https://buymeacoffee.com/christianhelle","https://www.buymeacoffee.com/christianhelle"],"categories":[],"sub_categories":[],"readme":"\u003c!--toc:start--\u003e\n\n- [HTTP File Generator](#http-file-generator)\n  - [Installation](#installation)\n  - [Usage](#usage)\n  - [Error Logging, Telemetry, and Privacy](#error-logging-telemetry-and-privacy)\n  - [VS Code Extension](#vs-code-extension)\n  - [Visual Studio 2022 Extension](#visual-studio-2022-extension)\n  \u003c!--toc:end--\u003e\n\n#\n\n[![Build](https://github.com/christianhelle/httpgenerator/actions/workflows/build.yml/badge.svg)](https://github.com/christianhelle/httpgenerator/actions/workflows/build.yml)\n[![Smoke Tests](https://github.com/christianhelle/httpgenerator/actions/workflows/smoke-tests.yml/badge.svg)](https://github.com/christianhelle/httpgenerator/actions/workflows/smoke-tests.yml)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=christianhelle_httpgenerator\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=christianhelle_httpgenerator)\n[![codecov](https://codecov.io/gh/christianhelle/httpgenerator/graph/badge.svg?token=YeSFnn0bH6)](https://codecov.io/gh/christianhelle/httpgenerator)\n\n# HTTP File Generator\n\nGenerate .http files from OpenAPI specifications\n\n`.http` files were made popular by the Visual Studio Code extension [REST Client](https://marketplace.visualstudio.com/items?itemName=humao.rest-client), which then was adopted by JetBrains IDE's, and later on [Visual Studio 2022](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.RestClient)\n\n## Installation\n\nHTTP File Generator now ships as a Rust CLI plus thin IDE hosts.\n\n- **crates.io**: `cargo install httpgenerator`\n  - Best when you already have Rust and Cargo (Rust 1.95+) on your machine and want the canonical Rust ecosystem install path for published releases.\n  - The public crates.io surface is the end-user CLI crate `httpgenerator` plus the reusable library crate `httpgenerator-core`.\n- **One-line installer (macOS/Linux)**: `curl -fsSL https://christianhelle.com/httpgenerator/install | bash`\n  - Best when you want the prebuilt CLI without installing the Rust toolchain.\n  - Use `curl -fsSL https://christianhelle.com/httpgenerator/install | INSTALL_DIR=$HOME/.local/bin bash` to install into a user-writable directory, or pass `--version \u003ctag\u003e` to pin a specific release.\n- **One-line installer (Windows PowerShell)**: `irm https://christianhelle.com/httpgenerator/install.ps1 | iex`\n  - Use `-InstallDir \u003cpath\u003e` to choose a custom directory or `-Version \u003ctag\u003e` to pin a specific release.\n- **Standalone CLI archives**: download the platform-specific archive from [GitHub Releases](https://github.com/christianhelle/httpgenerator/releases) and place `httpgenerator` / `httpgenerator.exe` on `PATH`.\n  - `httpgenerator-\u003cversion\u003e-linux-x64.tar.gz`\n  - `httpgenerator-\u003cversion\u003e-darwin-x64.tar.gz`\n  - `httpgenerator-\u003cversion\u003e-darwin-arm64.tar.gz`\n  - `httpgenerator-\u003cversion\u003e-win-x64.zip`\n- **Build locally**: `cargo build --release -p httpgenerator`\n- **Workspace testing**: `cargo test --workspace`\n- **VS Code**: install the platform-specific `.vsix` for your OS and architecture. Each package bundles the native Rust CLI, and you can override it with `http-file-generator.executablePath`.\n- **Visual Studio 2022**: install the Visual Studio `.vsix`, which bundles `httpgenerator.exe`.\n\nThe legacy `.NET` CLI remains in the repository as the migration oracle and compatibility host, but it is no longer the primary release path.\n\ncrates.io complements rather than replaces the existing release channels. Use crates.io for Rust-native installation and library consumption, use the install scripts or GitHub Releases for prebuilt standalone CLI binaries, and use the VS Code / Visual Studio Marketplace packages when you want the editor hosts with their bundled binaries.\n\nThe standalone release matrix currently covers Linux x64, macOS x64, macOS ARM64, and Windows x64. Windows on ARM currently uses the x64 standalone install path.\n\n### Repository layout\n\n- `src\\rust` contains the two Rust workspace projects: `src/rust/cli` for the `httpgenerator` CLI package and `src/rust/core` for the `httpgenerator-core` library package.\n- `src\\dotnet` contains the legacy .NET CLI, core library, test suite, and Visual Studio VSIX host.\n- `src\\vscode` contains the VS Code extension.\n- Root-level entrypoints are preserved: run Cargo commands from the repository root via `Cargo.toml`, target the moved .NET solutions with `src/dotnet/*.slnx`, and invoke VS Code packaging with `src\\vscode\\build.ps1`.\n- Plain `cargo publish --dry-run --allow-dirty` from the repo root attempts both Rust packages: `httpgenerator-core` and `httpgenerator`. CI still checks publish readiness in dependency order with `cargo publish --dry-run -p httpgenerator-core` plus `cargo check -p httpgenerator`.\n\n### Public vs private Rust crates\n\n- `httpgenerator` is the public CLI crate and the package normal users install with `cargo install httpgenerator`.\n- `httpgenerator-core` is the public library crate for the normalized model, `.http` rendering pipeline, and the `httpgenerator_core::openapi::*` loading/inspection/normalization API.\n- Differential compatibility coverage remains in the repository as test-only support under `src/rust/cli/tests`.\n\n## Usage\n\n```text\nUSAGE:\n    httpgenerator [URL or input file] [OPTIONS]\n\nEXAMPLES:\n    httpgenerator ./openapi.json\n    httpgenerator ./openapi.json --output ./\n    httpgenerator ./openapi.json --output-type onefile\n    httpgenerator https://petstore.swagger.io/v2/swagger.json\n    httpgenerator https://petstore3.swagger.io/api/v3/openapi.json --base-url https://petstore3.swagger.io\n    httpgenerator ./openapi.json --authorization-header Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9c\n    httpgenerator ./openapi.json --azure-scope [Some Application ID URI]/.default\n    httpgenerator ./openapi.json --generate-intellij-tests\n    httpgenerator ./openapi.json --custom-header X-Custom-Header: Value --custom-header X-Another-Header: AnotherValue\n\nARGUMENTS:\n    [URL or input file]    URL or file path to OpenAPI Specification file\n\nOPTIONS:\n                                                                DEFAULT\n    -h, --help                                                                       Prints help information\n    -v, --version                                                                    Prints version information\n    -o, --output \u003cOUTPUT\u003e                                       ./                   Output directory\n        --no-logging                                                                 Don't log errors or collect telemetry\n        --skip-validation                                                            Skip validation of OpenAPI Specification file\n        --authorization-header \u003cHEADER\u003e                                              Authorization header to use for all requests\n        --load-authorization-header-from-environment                                 Load the authorization header from an environment variable or define it in the\n                                                                                     .http file. You can use --authorization-header-variable-name to specify the\n                                                                                     environment variable name\n        --authorization-header-variable-name \u003cVARIABLE-NAME\u003e    authorization        Name of the environment variable to load the authorization header from\n        --content-type \u003cCONTENT-TYPE\u003e                           application/json     Default Content-Type header to use for all requests\n        --base-url \u003cBASE-URL\u003e                                                        Default Base URL to use for all requests. Use this if the OpenAPI spec doesn't\n                                                                                     explicitly specify a server URL\n        --output-type \u003cOUTPUT-TYPE\u003e                             OneRequestPerFile    OneRequestPerFile generates one .http file per request. OneFile generates a\n                                                                                     single .http file for all requests. OneFilePerTag generates one .http file per\n                                                                                     first tag associated with each request\n        --azure-scope \u003cSCOPE\u003e                                                        Azure Entra ID Scope to use for retrieving Access Token for Authorization header\n        --azure-tenant-id \u003cTENANT-ID\u003e                                                Azure Entra ID Tenant ID to use for retrieving Access Token for Authorization\n                                                                                     header\n        --timeout \u003cSECONDS\u003e                                     120                  Timeout (in seconds) for writing files to disk\n        --generate-intellij-tests                                                    Generate IntelliJ tests that assert whether the response status code is 200\n        --custom-header                                                              Add custom HTTP headers to the generated request\n        --skip-headers                                                               Don't generate header parameters in the files\n```\n\nRunning the following:\n\n```sh\nhttpgenerator https://petstore.swagger.io/v2/swagger.json\n```\n\nOutputs the following:\n\n![CLI Output](https://github.com/christianhelle/httpgenerator/raw/main/images/httpgenerator-output.png)\n\nWhich will produce the following files:\n\n```sh\n-rw-r--r-- 1 christian 197121  593 Dec 10 10:44 DeleteOrder.http\n-rw-r--r-- 1 christian 197121  231 Dec 10 10:44 DeletePet.http\n-rw-r--r-- 1 christian 197121  358 Dec 10 10:44 DeleteUser.http\n-rw-r--r-- 1 christian 197121  432 Dec 10 10:44 GetFindPetsByStatus.http\n-rw-r--r-- 1 christian 197121  504 Dec 10 10:44 GetFindPetsByTags.http\n-rw-r--r-- 1 christian 197121  371 Dec 10 10:44 GetInventory.http\n-rw-r--r-- 1 christian 197121  247 Dec 10 10:44 GetLoginUser.http\n-rw-r--r-- 1 christian 197121  291 Dec 10 10:44 GetLogoutUser.http\n-rw-r--r-- 1 christian 197121  540 Dec 10 10:44 GetOrderById.http\n-rw-r--r-- 1 christian 197121  275 Dec 10 10:44 GetPetById.http\n-rw-r--r-- 1 christian 197121  245 Dec 10 10:44 GetUserByName.http\n-rw-r--r-- 1 christian 197121  513 Dec 10 10:44 PostAddPet.http\n-rw-r--r-- 1 christian 197121  521 Dec 10 10:44 PostCreateUser.http\n-rw-r--r-- 1 christian 197121  610 Dec 10 10:44 PostCreateUsersWithListInput.http\n-rw-r--r-- 1 christian 197121  464 Dec 10 10:44 PostPlaceOrder.http\n-rw-r--r-- 1 christian 197121  299 Dec 10 10:44 PostUpdatePetWithForm.http\n-rw-r--r-- 1 christian 197121  274 Dec 10 10:44 PostUploadFile.http\n-rw-r--r-- 1 christian 197121  513 Dec 10 10:44 PutUpdatePet.http\n-rw-r--r-- 1 christian 197121  541 Dec 10 10:44 PutUpdateUser.http\n```\n\nIn this example, the contents of `PostAddPet.http` looks like this:\n\n```sh\n@contentType = application/json\n\n#############################################\n### Request: POST /pet\n### Summary: Add a new pet to the store\n### Description: Add a new pet to the store\n#############################################\n\nPOST https://petstore3.swagger.io/api/v3/pet\nContent-Type: {{contentType}}\n\n{\n  \"id\": 0,\n  \"name\": \"name\",\n  \"category\": {\n    \"id\": 0,\n    \"name\": \"name\"\n  },\n  \"photoUrls\": [\n    \"\"\n  ],\n  \"tags\": [\n    {\n      \"id\": 0,\n      \"name\": \"name\"\n    }\n  ],\n  \"status\": \"available\"\n}\n```\n\nand the contents of `GetPetById.http` looks like this:\n\n```sh\n@contentType = application/json\n\n#######################################\n### Request: GET /pet/{petId}\n### Summary: Find pet by ID\n### Description: Returns a single pet\n#######################################\n\n### Path Parameter: ID of pet to return\n@petId = 0\n\nGET https://petstore3.swagger.io/api/v3/pet/{{petId}}\nContent-Type: {{contentType}}\n```\n\nwith the `--generate-intellij-tests` option, the output looks like this:\n\n```sh\n@contentType = application/json\n\n#######################################\n### Request: GET /pet/{petId}\n### Summary: Find pet by ID\n### Description: Returns a single pet\n#######################################\n\n### Path Parameter: ID of pet to return\n@petId = 1\n\nGET https://petstore3.swagger.io/api/v3/pet/{{petId}}\nContent-Type: {{contentType}}\n\n\u003e {%\n    client.test(\"Request executed successfully\", function() {\n        client.assert(\n            response.status === 200,\n            \"Response status is not 200\");\n    });\n%}\n```\n\nHere's an advanced example of generating `.http` files for a REST API hosted on Microsoft Azure that uses the Microsoft Entra ID service as an STS. For this example, I use PowerShell and Azure CLI to retrieve an access token for the user I'm currently logged in with.\n\n```powershell\naz account get-access-token --scope [Some Application ID URI]/.default `\n| ConvertFrom-Json `\n| %{\n    httpgenerator `\n        https://api.example.com/swagger/v1/swagger.json `\n        --authorization-header (\"Bearer \" + $_.accessToken) `\n        --base-url https://api.example.com `\n        --output ./HttpFiles\n}\n```\n\nYou can also use `--azure-scope` and `--azure-tenant-id` to let the Rust CLI acquire an access token during generation. The CLI currently checks Azure CLI and Azure Developer CLI logins and keeps generation running even if token acquisition fails.\n\n```powershell\nhttpgenerator `\n  https://api.example.com/swagger/v1/swagger.json `\n  --azure-scope [Some Application ID URI]/.default `\n  --base-url https://api.example.com `\n  --output ./HttpFiles\n```\n\n### Error Logging, Telemetry, and Privacy\n\nThe Rust CLI keeps a sink-agnostic telemetry recorder that can capture feature usage and redacted error context.\n\nBy default, logging is enabled, but `--no-logging` disables feature and error event recording entirely.\n\nUser tracking is anonymous and derived from the **Support key** shown when running the tool while logging is enabled.\n\n```sh\nHTTP File Generator v0.1.5\nSupport key: mbmbqvd\n```\n\nThe support key is just the first 7 characters of the generated anonymous identity. Authorization headers are recorded as **`[REDACTED]`**, and personal machine details are normalized before telemetry is emitted.\n\nNo **support key** is generated when you opt out with `--no-logging`.\n\n### VS Code Extension\n\nThe VS Code extension is now packaged per platform because it bundles the native Rust CLI.\n\nWhen `http-file-generator.executablePath` is empty, the extension looks for a bundled binary, repo-root workspace `target\\debug` / `target\\release` outputs, and finally `httpgenerator` on `PATH`. That means a Cargo-installed `httpgenerator` binary can also satisfy the extension if you prefer to manage the CLI yourself.\n\n### Visual Studio 2022 Extension\n\nThis tool is also available as a [Visual Studio 2022 extension](https://marketplace.visualstudio.com/items?itemName=ChristianResmaHelle.HttpGenerator)\n\nFrom the **Tools** menu select **Generate .http files**\n\n![Tools menu](https://github.com/christianhelle/httpgenerator/blob/main/images/vsix_tools.png?raw=true)\n\nThis opens the main dialog which has similar input fields as the CLI tool and now shells out to the Rust `httpgenerator` executable.\n\nThe Visual Studio extension resolves `httpgenerator.exe` from `HTTPGENERATOR_PATH`, the bundled VSIX payload, repo-root workspace `target\\debug` / `target\\release` outputs during development, or `PATH`. A Cargo-installed CLI can therefore be reused here as long as the binary is discoverable on `PATH` or via `HTTPGENERATOR_PATH`.\n\n![Main dialog](https://github.com/christianhelle/httpgenerator/blob/main/images/vsix_httpgenerator_dialog.png?raw=true)\n\nYou can supply Azure Entra ID tenant and scope settings by clicking on the `...` button beside the **Authorization Headers** input field. The Rust CLI acquires the access token during generation.\n\n![Acquire Azure Entra ID access token](https://github.com/christianhelle/httpgenerator/blob/main/images/vsix_azure_entra_id.png?raw=true)\n\nBy default, the **Output folder** is pre-filled with the path of the currently active C# Project in the Solution Explorer, suffixed with **\\HttpFiles**\n\n![Solution explorer](https://github.com/christianhelle/httpgenerator/blob/main/images/vsix_solution_explorer.png?raw=true)\n\nOnce the .http files are generated you can easily open and inspect them\n\n![.http file](https://github.com/christianhelle/httpgenerator/blob/main/images/vsix_http_file.png?raw=true)\n\n#\n\nFor tips and tricks on software development, check out [my blog](https://christianhelle.com)\n\nIf you find this useful and feel a bit generous then feel free to [buy me a coffee ☕](https://www.buymeacoffee.com/christianhelle)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristianhelle%2Fhttpgenerator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchristianhelle%2Fhttpgenerator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristianhelle%2Fhttpgenerator/lists"}