Git Product home page Git Product logo

rxrapidapi's Issues

No argument endpoints throw errors

@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.

RxRapidApiBuilder isnt a true Builder

Points of note:

  • Keep the RxRapidApiBuilder.from() convenience method.
  • Implement RxRapidApiBuilder.from() in terms of the builder pattern.
  • Have tests that use both the RxRapidApiBuilder.from() and builder pattern.
  • Other stories to follow once the builder pattern is available.

Move wiki -> gh-pages

Basic "README" page is up with a stock template. What still needs to be done:

  • Getting started
  • Configuration + Builder
  • Contribution Guide (yes, pull requests accepted, but keep the tests passing and static code analysis clean)

Treat missing type parameter as an error

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.

Server is hard-coded

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.

Null values should be skipped

Passing a null as an optional value gets encoded as the String "null" right now. It ought to skip that value entirely.

Support RxJava "Single<>" observables

In addition to declaring interface methods as returning Observable<>, the SDK should support users who want them to return Single<>.

Notes

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.

  • onSuccess - a Single passes this method the sole item that the Single emits
  • onError - a Single passes this method the Throwable that caused the Single to be unable to emit an item

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.

How to handle custom return types

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?

Code snippet for RapidAPI dashboard

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.

Default parameters

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.

Wiki documentation

Run through the wiki

  • Javadoc
  • Make sure that everything is polished
  • Document fully-formed API interfaces in the demo
  • Showing the latest versions / latest annotations
  • Display best practices up-front
  • All builder methods

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.