Convert mitmproxy captures to OpenAPI 3.0
masterTo reverse-engineer a REST API from mitmproxy traffic, follow these steps:
- Capture Traffic: Use
mitmwebormitmproxyto capture the desired HTTP traffic. Ensure your client is configured to use the proxy. - Save Flow: Save the captured traffic to a flow file (e.g., via the "File" > "Save" menu in
mitmweb). - First Pass: Run the tool to generate an initial schema with path templates.
- Edit Schema: Open the generated schema file. You will see paths prefixed with
ignore:. Remove theignore:prefix from the paths you want to include in the final specification and adjust parameters as needed. - Second Pass: Run the tool again on the same schema file to generate the actual endpoint descriptions. Use the
--examplesor--headersflags to include extra data (use caution with sensitive information).