Question: I inherited an existing API and I would like to document it with swagger, but I don't yet know the full scope of it. Can Swagger (or another middleware/tool) auto-magically generate the yaml (for swagger) based on the existing express routes?

For what I saw on other questions, it would appear that this is mostly a manual job, but I'm double-checking if someone here found a way around this.

Answer: 
There is an option: you can embed middleware that will analyse all requests and responses and generate specification for you: <https://github.com/mpashkovskiy/express-oas-generator>

Then you can use it through your's app Swagger UI like <http://host:port/api-docs>
**Yes !!!**. You can use this awesome project [typescript-test](https://github.com/thiagobustamante/typescript-rest). Here is [sample app](https://github.com/vrudikov/typescript-rest-boilerplate). Clone it, run `npm i`,`npm run swagger` and go to */dist/swagger.json*. Done. Swagger yaml and json is generated based on express routes !