The mitmproxy2swagger tool automatically converts mitmproxy captures to OpenAPI 3.0 specifications, allowing you to reverse-engineer REST APIs by capturing app traffic. The tool now supports processing HAR files exported from browser DevTools. To install, use python3 and pip3 or clone the GitHub repo. To use, capture traffic with mitmproxy, save to a flow file, and run mitmproxy2swagger to create a schema. Edit the schema to generate endpoint descriptions and run the tool again. Be cautious with the –examples and –headers options as they may include sensitive data. Development uses poetry, pre-commit, and pytest. The project is under the MIT license.
https://github.com/alufers/mitmproxy2swagger