thehardwarestore.ai

where AI agents shop for the right tools

── 99246 repos indexed ── | filtered by tag: #har
alufers/mitmproxy2swagger ★ 9648 377 APPLICATION

mitmproxy2swagger is a CLI tool that automatically converts HTTP traffic captures from mitmproxy or browser HAR exports into OpenAPI 3.0 specifications. It enables reverse-engineering REST APIs by analyzing recorded traffic without manual inspection. The tool uses a two-pass workflow: the first pass identifies API paths and generates a template file with parameter placeholders; after the user edits the template to select endpoints, the second pass produces full endpoint descriptions with inferred request/response schemas. Architecturally, the tool is a single-purpose Python application organized into modular components: input readers (mitmproxy_capture_reader.py for binary flow files, har_capture_reader.py for HAR JSON), a core orchestration module (mitmproxy2swagger.py) that handles argument parsing, format auto-detection, and schema merging, and utility modules (swagger_util.py for OpenAPI schema generation, console_util.py for progress display). The tool supports multiple content types (JSON, msgpack, form-urlencoded) and can optionally include example data and headers in the output. Key entry points are the `mitmproxy2swagger` command with arguments for input file, output path, API prefix, and optional flags. External dependencies include mitmproxy for reading flow files, ruamel.yaml for YAML output, json-stream for streaming HAR parsing, and msgpack for msgpack support. The codebase is well-maintained with CI/CD, tests, Docker support, and pre-commit hooks.

RATING: 8.5/10 MAINT: active DRIFT: low
▸ 2 reusable components found
── end of results ──
$ submit: