Hacker News new | ask | show | jobs
by CharlieDigital 979 days ago
If you want to do that, try gRPC and Proto.

But I feel like REST and OpenAPI are fine especially if you start from the backend. I think with .NET Web APIs, the story is particularly good since it has out-of-the-box tooling for OpenAPI spec generation based on your exposed endpoints and models and then the option to customize that as needed.

I've recently been working with it trying to get hot reload working on the frontend client generation and it's a fantastic DX with minimal wiring: https://chrlschn.dev/blog/2023/10/end-to-end-type-safety-wit...

2 comments

Grpc browser support is pretty bad, I still can't wrap my head around the whole grpc-web thing that looks like giant hacks.

Openapi is not human readable IMO and the point is you design the API waaaay before you write any line of code. The api should express the business needs and be a two way discussion with the frontend people.

OpenAPI itself doesn't need to be human readable because it's readily translated into human readable form using tools like Redocly, RapiDoc, or any other host of tools that create output documents from input OpenAPI spec.
There’s also Twirp, if gRPC doesn’t fit your requirements.