mitmproxy2swagger: Automagically Reverse-Engineer REST APIs

2025-01-02

mitmproxy2swagger is a powerful tool that automatically converts mitmproxy captured traffic into OpenAPI 3.0 specifications. This allows you to automatically reverse-engineer REST APIs simply by running your apps and capturing the traffic. It supports both mitmproxy flow files and HAR files exported from browser developer tools. To use it, capture traffic with mitmproxy, save it as a file, and then run mitmproxy2swagger, specifying the input file, output file, and API prefix. The first run generates an initial schema which requires manual editing to remove unwanted paths. A second run generates the complete OpenAPI specification based on the edited schema, optionally including example data.

Development