harspec GitHub

FAQ

What is a HAR file?

HTTP Archive: a JSON file that records every request and response a page made. Browsers export it from the Network tab of DevTools.

Is the generated spec complete?

No. It describes only what you captured. Unseen endpoints, fields and errors are missing, and "required" means "present in every sample". Treat the result as a strong draft and review it.

How do I get a better spec?

Capture more: every screen, search, create, update, delete, and a few failures. Merge knowledge by running several captures and comparing.

Does it support GraphQL?

Calls show up as one POST /graphql operation with the request and response shapes seen. Per-query modelling is on the roadmap.

Does it work with mobile apps or desktop apps?

Yes, if you can record their traffic as HAR (mitmproxy, Charles and Proxyman can export HAR).

My response bodies are empty in the spec.

Some exports omit bodies. In Chrome use Save all as HAR with content. Some responses (large or binary) are never stored.

Is it safe to run on a HAR with tokens?

Secrets are redacted in all output and nothing leaves your machine. Still treat the HAR itself as sensitive.

Which Python versions?

3.9 and newer. No third-party packages.

Why does the generated Python client need requests?

harspec itself has no dependencies, but the generated client uses requests because most Python developers already have it. A generator for httpx or the standard library is a nice first contribution.

Can I use the output in a commercial project?

harspec is MIT licensed, so the tool and its generated code are free to use. Whether you may use a given third-party API is governed by that service's terms.

How is this different from other tools?

Many tools show you traffic; harspec turns it into documentation and code and is built to be extended. Note: another unrelated project uses a similar name; harspec is not affiliated with it.

How do I contribute or report a bug?

See Contributing.