Hacker News new | past | comments | ask | show | jobs | submit | mercurysmessage's favorites login

FAST Api is a nice library, but it uses code-based api specifications. It's generates the spec from code. So you need to write your API code by hand first, and do serialization manually...

This is an important distinction and might not be what you want.

Using spec first API design makes more sense IMHO. You first spec your API (Either in OpenAPI or GRPC or whatever Interface Definition Language you use). This allows Backend and Frontend developers to change the API definition.

From there you generate all type-save model objects, client and server stubs, and fill in the implementation with full type hinting.

At my current company, we wrote OpenAPI specs first, no need to know Python. And use https://openapi-generator.tech/ to generate both the Python server, python client and typescript client. We're looking into generate Kotlin and Swift clients too...

I'm a big proponent of spec first API design. It's much cheaper to agree on a spec first before you start coding.

But it depends on what you are doing.

Personally I like GRPC best, since the code generators are top notch.

Very good article on this principle:

https://medium.com/apis-and-digital-transformation/openapi-a...

First, stop writing interface code for your APIs by hand. Second, stop writing interface code for your APIs by hand. Third, stop writing interface code for your APIs by hand.

We're living in 2021... Every time I see somebody manually mapping an objects to a JSON dictionary I'm crying in the inside. It's like writing machine code by hand.


Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: