Better HN
topnewbestaskshowjobs
Log inSign up

ForeverAPadawan

1 karma · joined Feb 5, 2021 (5y ago) · 11 submissions

Submissions

1.

Ask HN: How to get the safe retry exponential and jitter values? [Microservices]

1 points · by ForeverAPadawan · 5y ago · discuss

2.

Ask: We use Rest API in our SPAs but famous SPAs don’t follow the norm

4 points · by ForeverAPadawan · 5y ago · discuss

comment 5y ago · link · parent

Yes I'm sure. The team that I joined surprisingly writes very little logic.

In order to implement a JSON GET and POST to one endpoint, they had to write 186 lines of code and unit tests so something is clearly wrong!

Even just being smarter on manually writing the client will save us a lot of time.

comment 5y ago · link · parent

We don't use GraphQL. I never heard of QuickType before so thanks for that.

comment 5y ago · link · parent

Thanks for you reply.

Yes, the answer to your question is to auto-generate the client. But as I mentioned, the current generators has drawbacks. They are buggy, produces ugly code, and hard to customize.

How do you test that the client can actually still call the server when you make changes to the server? Do you have automated tests?

comment 5y ago · link · parent

AutoRest is one of those buggy generators that I mentioned.

I agree that generated clients are ugly which is one reason why I'm hesitant. On the other hand, generators saves time and doesn't need to be tested (If you can trust the generator).

The other option that I'm thinking of is to create my own template for one of those OpenAPI generator so that the client code isn't ugly but creating a template is not a trivial task.

I'm wondering companies that has tons of REST microservices do it.

comment 5y ago · link · parent

You mean at runtime? We use a type-safe language and prefer to keep it that way

8.

Ask HN: Should we waste hours writing REST API clients?

3 points · by ForeverAPadawan · 5y ago · 13 comments