Hacker News new | ask | show | jobs
by ccleve 2051 days ago
Nobody writes OpenAPI directly. You use an API design tool for that.

There are two ways to design APIs: code-first and design-first.

With code-first you write your code and then automatically generate the OpenAPI spec from that. I do it in Java using JAX RS and it works fine. It is strongly-typed and has all of the same advantages you get by designing your protobuffers first.

The world is moving toward design-first, though. You use a tool to write your API and then generate code from that. It's a nice idea, but I'm not there yet because I don't like the tooling.

I expect that in a few years the tooling will be good and we'll be able to generate both APIs and database schemas in one place. Looking forward to it.