Skip to content

Comment on Show HN: Auto-generate an OpenAPI spec by listening to localhostparent

Comments

You can write an OpenAPI spec in JSON. You can use Jsonnet to generate your spec from whatever input you need.

JSON is a different kind of yuck to have to author by hand, especially in the volume an api spec tends to be.

I don't like writing structured formats by hand either - at some point, you either need to, as they say in France, split or get off your seat

Either don't write it by hand, i.e. use a generator for the structured format, as the comments advocate for and article is about.

Or, just say you'll never have a spec.

Yes, so use Jsonnet or generate it from some intermediate representation using some alternative method. What’s the problem?

Why though when I can just generate it from my actual code and not have to maintain two copies of my api spec?

Jsonnet introduces another (flawed) language?

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.