RapidSoftwareSolutions / rapidapi-android-sdk

Find, try and connect to APIs easily with the RapidAPI marketplace
http://rapidapi.com
2 stars 4 forks source link

Code sample doesnt compile #3

Closed psh closed 7 years ago

psh commented 7 years ago

I picked this at random, it probably holds for other APIs as well.

import com.rapidapi.rapidconnect.RapidApiConnect;

RapidApiConnect connect = new RapidApiConnect('foo', 'bar-bar-bar-bar');

Map<String, Argument> body = new HashMap<String, Argument>();

body.put("date", new Argument("data", ""));
body.put("highResolution", new Argument("data", ""));
body.put("apiKey", new Argument("data", "xxx-xxx-xxx-xxx"));

try { 
    Map<String, Object> response = connect.call('NasaAPI', 'getPictureOfTheDay', body);
if(response.get("success") != null) { 

 } else{ 

 } 
} catch(Exception e){ 

 }

You are using single quotes (character literals) where you meant to have double quotes (strings) - creating the RapidApiConnect instance and connect.call

Bukati commented 7 years ago

Fixed, Thank you

psh commented 7 years ago

I looked at the Slack API as an example - you fixed one instance of the defect and missed the second.

Expected result:

Map<String, Object> response = connect.call("Slack", "revokeAuth", body);

Current / Actual result:

Map<String, Object> response = connect.call('Slack', 'revokeAuth', body);
Bukati commented 7 years ago

Hey, The fix isn't in production yet. It will be there in a hour.

Thank you for your time

psh commented 7 years ago

You're welcome!