5 ms·
I'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
by derefr 11y ago
I'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