Git Product home page Git Product logo

rxrapidapi's Introduction

RxRapidApi

License Version Stories in Ready CircleCI

RxRapidApi is a Rapid Api client sdk that provides a type-safe, RxJava powered interface to Rapid API services.

Documentation

Documentation is available on the wiki.

Download

RxRapidApi is available from jcenter - via Gradle

compile 'com.gatebuzz:rxrapidapi:1.0.0'

or maven

<dependency>
  <groupId>com.gatebuzz</groupId>
  <artifactId>rxrapidapi</artifactId>
  <version>1.0.0</version>
  <type>pom</type>
</dependency>

License

Copyright 2016 Paul S Hawke

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

rxrapidapi's People

Contributors

psh avatar waffle-iron avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

waffle-iron jxljf

rxrapidapi's Issues

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.

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.

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.

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.

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?

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

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.

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.

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.

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.