Hacker News new | ask | show | jobs
by sdevonoes 1965 days ago
Retrofit, OpenAPI, Postman, Apimatic... they old smell as "complexity not needed".

> Spend hours writing the client, testing, and reviewing the code feels very wrong to me. To make things worst, the tests aren't good enough because there are no integration or contract tests. The client tests will still pass even if the API's URL is changed.

There you got your answer: write a tiny wrapper/library that gives you a generic way to write the client. It's not rocket science exactly (so no need to add yet another framework). As for the tests, well, just add tests that you find meaningful.

> It seems that I don't need contract testing to test the schema if I'm already using OpenAPI

How's OpenAPI prevent you from writing tests? Unless you auto-generate the client code (but that's another bad choice imo).

1 comments

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?