rxrapidapi / rxrapidapi Goto Github PK
View Code? Open in Web Editor NEWA Rapid Api client sdk that provides a type-safe, RxJava powered interface to Rapid API services.
License: Apache License 2.0
A Rapid Api client sdk that provides a type-safe, RxJava powered interface to Rapid API services.
License: Apache License 2.0
Show the power of the dark side!
@Application(project = BuildConfig.PROJECT, key = BuildConfig.API_KEY)
public interface HackerNewsApi {
@ApiPackage("HackerNews")
Observable<Map<String, Object>> getBestStories();
}
Throws an exception when invoked: java.lang.IllegalStateException: Multipart body must have at least one part.
Integrate project with waffle.io
Points of note:
RxRapidApiBuilder.from()
convenience method.RxRapidApiBuilder.from()
in terms of the builder pattern.RxRapidApiBuilder.from()
and builder pattern.local.properties
Once the builder pattern is available, add an .application(project, key)
method to the builder to allow the @Application
annotation to become optional.
Basic "README" page is up with a stock template. What still needs to be done:
The RxRapidApiBuilder
silently assumes that a KeyValueMapProcessor
will work when no parameterized type is specified as a return value. This should probably throw an exception instead.
As things stand, there's no way to point this SDK at an enterprise installation of RapidAPI. Consider how to override the hard-coded server in the builder interface.
Passing a null as an optional value gets encoded as the String
"null" right now. It ought to skip that value entirely.
The current SDK only sends "data" parameters, not "file".
In addition to declaring interface methods as returning Observable<>
, the SDK should support users who want them to return Single<>
.
A Single is something like an Observable, but instead of emitting a series of values โ anywhere from none at all to an infinite number โ it always either emits one value or an error notification.
A Single will call only one of these methods, and will only call it once. Upon calling either method, the Single terminates and the subscription to it ends.
When the "success" return value is obviously JSON formatted but is coming back as a String
, is there anything that the SDK can do to (maybe) parse it automatically?
Create a snippet that developers can copy and paste into their code.
For reference:
The Android snippet looks like that:
import com.rapidapi.rapidconnect.RapidApiConnect;\n\nRapidApiConnect connect = new RapidApiConnect(PROJECT, KEY);\n\nMap<String, Argument> body = new HashMap<String, Argument>();\n\nparamslist\n\n
try { \n\tMap<String, Object> response = connect.call(packagename, blockname, body);\nif(response.get(\"success\") != null) { \n\n\n } else{ \n\n\n } \n} catch(Exception e){ \n\n\n }
where PROJECT, KEY and paramlist are dynamically replaced with the project's details.
Make the @ApiPackage
annotation work like @Application
to reduce noise in interface definitions.
When calling APIs that require an API key in every method, it would be nice to reduce the interface noise and specify this parameter as a default.
Take a look at EventBrite as an example (there may be others) - looks like there are websocket based webhooks that can be handled.
See also: https://github.com/RapidSoftwareSolutions/rapidapi-android-sdk
Run through the wiki
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.