I've just taken over a 5-year-old legacy project, and there's absolutely no API documentation available. There's no Swagger or OpenAPI, no Postman collections, and the frontend has a bunch of hardcoded URLs. While I could trace every endpoint manually, that would take way too long.
I'm looking for some fast and reliable methods to generate API documentation from what I have. I've heard from some developers that using packet-capture tools like mitmproxy, Fiddler, and Proxyman can help you record all HTTP traffic and then import that data into platforms like Apidog or Postman to create organized API documentation.
Has anyone had experience with this on an older service? Did it work out, or was it more trouble than it's worth? I'm curious about how DevOps or infrastructure teams tackle undocumented backend systems in practice.
5 Answers
Check out Autoswagger! It can automatically generate Swagger documentation from your existing code. It might be a quick win for you!
You might want to give GitHub Copilot a try! It can help you navigate through the code and suggest documentation.
Have you tried using LLMs like ChatGPT? They can assist in creating documentation based on existing code.
If you have any monitoring tools in place, look for server requests categorized by endpoint. It could give you a clear view of the API structure.
Consider adding Swagger directly to your project. It helps auto-generate a list of endpoints and their inputs. A solid way to kickstart your docs!

Just be cautious with the output. Expect around 80% accuracy. You might find that static analysis tools give you deeper insights.