Hacker News new | ask | show | jobs
by Bogdanp 2815 days ago
I'm not familiar with Connexion (this was my first time hearing about it), but it seems, from reading its README, that the two approaches are polar opposites: in Connexion you write the schema first and that is used to hook up your API to your business logic, whereas in molten you write your API using normal Python code and idioms and an OpenAPI schema is generated from that code. As a user of Molten, you don't need to know anything about OpenAPI to be able to use it.
1 comments

Molten does what I've seen in RoR land do. You decorate and document your schema. It then can spit out an OpenAPI spec, use its schema and tooling around OpenAPI.

So it becomes a choice. A decision of writing mostly OpenAPI, or writing Python via an API that is defined by someone (or a small set of people).

I'd personally rather learn OpenAPI specs as you're going to live in that world anyways, as it gives you so much tooling.

It's not hard, and you could take that yaml file and generate code for other languages in case Python's performance specifically for that API (especially it if is a microservice), runs too slowly in the real world and need a faster runtime, etc.