3 ms·
Why does every API need its own set of client libraries? Wasn't the promise of RESTful APIs to obviate the need for such? Is it perhaps because basic JSON hand
by pbreit 7y ago
Why does every API need its own set of client libraries? Wasn't the promise of RESTful APIs to obviate the need for such?
Is it perhaps because basic JSON handling and POST/GET processing is still so miserable in most environments?
- riquito 7y agoYou have a RESTful API. Good. You now want to communicate with it. You need to write some code (an SDK) to do the requests, or you can generate it automatically. If you write it yourself, you have to do it for every language you use, since you can't reuse SDK between different languages. Even worse, if you can't generate an SDK every person who access your service will end up writing different code to talk to your RESTful API. There are other advantages, like automatic documentation, easier management of versioning, schema/type verification, ...
- jayd16 7y agoYou could argue that OpenAPI is actually just a make-good on the HATEOS part of REST and not a new addition. And of course you don't need a custom library. Its just nicer to have one as it facilitates code completion and leverages the compiler you're using instead of some new validation tool.
- james_s_tayler 7y agoYeah. This is where I find libraries like Retrofit / Refit suit the model will. Very easy to just declare clients. I like using the models generated by OpenAPI tooling in conjunction with those type of libraries to build clients quickly while being able to maintain control over how the HTTP calls are happening. I'm bearish on 3rd party SDKs for apis these days as most are fairly thin wrappers around apis that don't add much value but give you little to no control over how the actual http calls are being made.
- executesorder66 7y agoTip: the word obviate means to make something unnecessary. So you don't need to add "the need" after the word obviate. You can just say "Wasn't the promise of RESTful APIs to obviate this?" Otherwise what you are really saying is -> "Wasn't the promise of RESTful APIs to remove the need the need for such?"
- pbreit 7y agoI dunno. To make the need unnecessary seems OK.
- GonzaloQuero 7y agoYou don't need these clients, though, they're just doing HTTP. Isn't this just a quick way of reducing boilerplate?