mitmproxy2swagger is a Python tool that converts captured HTTP traffic into OpenAPI 3.0 specifications. It can analyze mitmproxy flow files or HAR exports from browser developer tools. The first processing pass discovers candidate endpoints and path structures from observed requests. Users can review those paths before a second pass generates parameters, request bodies, responses, and endpoint descriptions. Existing schemas can be extended across multiple captures instead of being recreated from scratch. Optional flags can include examples and headers, although captured sensitive data must be handled carefully. The tool is useful for documenting undocumented APIs and authorized interoperability or testing workflows where observed traffic needs to become structured API documentation.
Features
- mitmproxy traffic conversion
- HAR file processing
- OpenAPI 3.0 specification generation
- Multi-pass endpoint refinement
- Existing schema merging
- Optional request and response examples