Live data from Hacker News

Show HN: Auto-generate an OpenAPI spec by listening to localhost

github.com

1–10 of 78 posts

Show HN: Auto-generate an OpenAPI spec by listening to localhost

#1
Hey HN! We've developed OpenAPI AutoSpec, a tool for automatically generating OpenAPI specifications from localhost network traffic. It’s designed to simplify the creation of API documentation by just using your website or service, especially useful when you're pressed for time.

Documenting endpoints one by one sucks. This project originated from us needing it at our past jobs when building 3rd-party integrations.

It acts as a local server proxy that listens to your application’s HTTP traffic and automatically translates this into OpenAPI 3.0 specs, documenting endpoints, requests, and responses without much effort.

Installation is straightforward with NPM, and starting the server only requires a few command-line arguments to specify how and where you want your documentation generated ex. npx autospec --portTo PORT --portFrom PORT --filePath openapi.json

It's designed to work with any local website or application setup without extensive setup or interference with your existing code, making it flexible for different frameworks. We tried capturing network traffic on Chrome extension and it didn't help us catch the full picture of backend and frontend interactions.

We aim in future updates to introduce features like HTTPS and OpenAPI 3.1 specification support.

For more details and to get started, visit our GitHub page (https://github.com/Adawg4/openapi-autospec). We also have a Discord community (https://discord.com/invite/CRnxg7uduH) for support and discussions around using OpenAPI AutoSpec effectively.

We're excited to hear what you all think!

Show HN: Auto-generate an OpenAPI spec by listening to localhost
github.com

Re: Show HN: Auto-generate an OpenAPI spec by listening to localhost

#4
This is probably cool and useful, but there's no way to know how much of the API you're covering, right?

I find that the real shortage of tools exists going the other way: from OpenAPI to code. The ecosystem has proven to be a huge disappointment there, comprising a janky collection of defective tools that still (years later) don't support version 3.1 (a critical update).

Re: Show HN: Auto-generate an OpenAPI spec by listening to localhost

#7
post #6

I thought I recalled something similar to this posted in the past. https://news.ycombinator.com/item?id=38012032 (5 months ago)

Love what Andrew is doing! We built this for localhost when testing vs. the client side with a Chrome extension.

Re: Show HN: Auto-generate an OpenAPI spec by listening to localhost

#8
post #5

I think pairing this tool with something that recursively clicks through app would be insanely helpful. (the latter is what I have trouble finding)

Open to ideas! We're thinking of adding agents/crawler suggestions to the github if there's a package that clicks around in that fashion
Post reply on HN