7 ms·
Because they are shallow layers over their REST API? There's nothing useful in there anyway.
by stuartaxelowen 11y ago
Because they are shallow layers over their REST API? There's nothing useful in there anyway.
- derefr 11y agoI'm surprised this hasn't been trivialized/automated away yet (or has it?) Some sort of language-neutral REST-protocol description language, that could be used to code-generate client libraries and also generate a test spec and documentation. Or maybe just a standard for media-types in HATEOS response types in specifying REST API "roots", to make them machine-discoverable, in a way where the result could be "cached into" a client-library.
- bluk 11y agoI believe the current most popular flavor is Swagger ( http://swagger.io http://swagger.io ) at the moment.
- bpicolo 11y agoDespite having such quirks as: no Null support =|
- encoderer 11y agoIME, especially building APIs for mobile apps: nulls suck anyway!
- bpicolo 11y agoYeah, but nonetheless, are sometimes necessary. The suggested way is to just remove the field entirely, which is really a different sort of null. Also, generic mapping types are second class citizens, id est just wanting to specify string -> string
- encoderer 11y agoI appreciate your point of view, but mine is different. For example, at Trulia, with a dozen different apps with millions of users and rich data in the app, there is a "no nulls" policy. It's just a convention: build sparse data structures instead of passing nulls.
- brianwawok 11y agoSo messing around with Python and rest APIs... Often a wrapper library for an API exists on github.. But why use it? If I use 6 APIs in my project I now just added 6 libraries that all do things like auth, connection pooling, error handling a little bit different. Meh. The actual work of code to json to API to json to code is simple (1 line usually), I would rather just learn the API and do it myself. You still need to learn the API to use the wrapper library...
- madeofpalk 11y agoI believe this is what AWS does to create all their libraries in the bazillion languages they support.
- pbreit 11y agoI could maybe see something like http://unirest.io http://unirest.io or, to a lesser extent, http://swagger.io http://swagger.io making sense.
- JonnieCache 11y agoSounds suspiciously like SOAP to me.
- haikuginger 11y agoThis is a shameless plug, so I'll take my beating if it's appropriate. For the last few months, I've been working on a Python library, beekeeper, that's all about that. It essentially consumes a JSON description file that gives all the specs for an API, as well as information about its object structure, and then provides an intuitive, native-Python interface, typically with little to no additional code required. You can check it out on GitHub at https://github.com/haikuginger/beekeeper https://github.com/haikuginger/beekeeper, read more at http://beekeeper.rtfd.org http://beekeeper.rtfd.org, or just install it with pip. I'm biased, but I think it's pretty cool.
- tomc1985 11y agoHonestly, unless the API is complex, why bother? I feel like abstracting APIs into objects (essentially RPC calls?) creates too much of a dependency on the network. The friction of writing the calls and their handlers helps minimize their use :)
- derefr 11y agoMainly because I code microservices in at least five languages, and want to be able to touch all the same third-parties from any given one of them.
- cptn_brittish 11y agoSounds like the soap protocol. I've had to deal with it recently at work and paired with the suds python library auto generates the api for you
- wing328hk 11y agoHave you tried using Swagger-Codegen (https://github.com/swagger-api/swagger-codegen https://github.com/swagger-api/swagger-codegen) to generate API clients, documentation (markdown) and test spec? Disclosure: I'm a top contributor to Swagger-Codegen
- pbreit 11y agoSo what is consensus on client libraries like this? Personally, I'd rather just use my own calls. Aren't most RESTful APIs simple enough not to need such libraries? And if they're not, it's a design failure? But then you have companies like Braintree that only supports its libraries?
- amyjess 11y agoA good client library should abstract away the rate limiting, at least. That is, it should keep track of how many requests you made over time, and if making another will put you over the rate limit, the library should block for however much time is needed before actually sending the request. For example, I can't imagine interacting with Reddit's API without praw taking care of the rate limiting for me.
- stuartaxelowen 11y agoEnterprise clients (the ones they care about) are likely making requests from multiple machines, meaning you have to track API usage per token in a database somewhere.