Expand description
§mitm2openapi
Convert mitmproxy flow dumps and HAR files to OpenAPI 3.0 specifications.
This crate provides both a CLI binary (mitm2openapi) and a library for
programmatic use. It supports mitmproxy flow dumps (v19–v21) and HAR 1.2 files.
§Workflow
discoverscans captured traffic and emits a curatable templates file.- The user curates the templates (or uses
--include-patterns/--exclude-patterns). generateproduces the final OpenAPI 3.0 YAML spec.
See the CLI documentation and the project README for examples.
Modules§
- builder
- cli
- error
- har_
reader - mitmproxy_
reader - output
- params
- path_
matching - Path template matching: convert path templates to regexes, match URLs against templates, detect parameter segments, and suggest parameterized templates from observed paths.
- schema
- Schema inference: convert JSON values to OpenAPI schemas.
- tnetstring
- TNetString (Tagged Netstring) parser for mitmproxy flow files.
- types
Constants§
- MAX_
BODY_ SIZE - Maximum body size for response/request bodies (64 MiB).
- MAX_
DEPTH - Maximum recursion depth for TNetString parsing.
- MAX_
INPUT_ SIZE - Maximum size of a single input file (2 GiB).
- MAX_
PAYLOAD_ SIZE - Maximum size of a single TNetString payload (256 MiB).
- MAX_
SCHEMA_ DEPTH - Maximum recursion depth for JSON-to-schema conversion.
Functions§
- validate_
input_ path - Validate that an input path is a regular file (not a symlink, FIFO, etc.) and within the configured size limit.