Code Monkey home page Code Monkey logo

rides-java-sdk's Introduction

Uber Rides Java SDK (Beta) Build Status

This SDK helps your Java App make HTTP requests to the Uber Rides API.

Setup

Installing

Before you begin

Register your app in the Uber developer dashboard. Notice that the app gets a client ID, secret, and server token required for authenticating with the API.

Note: Using Android? Be sure to checkout the Uber Android SDK in addition, which has native authentication mechanisms.

Gradle

Uber Rides SDK:

Maven Central

dependencies {
    compile 'com.uber.sdk:uber-rides:x.y.z'
}

Uber Oauth Client Adapter:

Maven Central

dependencies {
    compile 'com.uber.sdk:uber-core-oauth-client-adapter:x.y.z'
}

Maven

Uber Rides SDK:

Maven Central

<dependency>
  <groupId>com.uber.sdk</groupId>
  <artifactId>uber-rides</artifactId>
  <version>x.y.z</version>
</dependency>

Uber Oauth Client Adapter:

Maven Central

<dependency>
  <groupId>com.uber.sdk</groupId>
  <artifactId>uber-core-oauth-client-adapter</artifactId>
  <version>x.y.z</version>
</dependency>

Authenticating and creating a session

To make calls, you need to create an authenticated session with the API. While operations on behalf of users require a user-authorized token using OAuth 2, general requests can use server-token authentication.

Create a session using a server token

// Get the server token for your app from the developer dashboard.
SessionConfiguration config = new SessionConfiguration.Builder()
    .setClientId("YOUR_CLIENT_ID")
    .setServerToken("YOUR_SERVER_TOKEN")
    .build();

ServerTokenSession session = new ServerTokenSession(config));

Create a session using the OAuth 2 flow

In an OAuth session, the app first asks the user to authorize and then exchanges the authorization code for an access token from Uber. Note: Make sure the redirect URI matches the callback URI in the developer dashboard for the app.

Step 1. Create an OAuth2Credentials object with your client ID, client secret, scopes, and a redirect callback URI to capture the user’s authorization code.

SessionConfiguration config = new SessionConfiguration.Builder()
    .setClientId("YOUR_CLIENT_ID")
    .setClientSecret("YOUR_CLIENT_SECRET")
    .setScopes(yourScopes)
    .setRedirectUri(redirectUri)
    .build();
    
OAuth2Credentials credentials = new OAuth2Credentials.Builder()
    .setSessionConfiguration(config)
    .build();
    

Step 2. Navigate the user to the authorization URL from the OAuth2Credentials object.

String authorizationUrl = credentials.getAuthorizationUrl();

Step 3. Once the user approves the request, you get an authorization code. Create a credential object to store the authorization code and the user ID.

Credential credential = credentials.authenticate(authorizationCode, userId);

Step 4. Create a session object using the credential object.

CredentialsSession session = new CredentialsSession(config, credential)

Step 5. Instantiate a service using a session to start making calls.

RidesService service = UberRidesApi.with(session).createService();

Note: Keep each user's access token in a secure data store. Reuse the same token to make API calls on behalf of your user without repeating the authorization flow each time they visit your app. The SDK handles the token refresh automatically when it makes API requests with an UberRidesService.

Sync vs. Async Calls

Both synchronous and asynchronous calls work with the Uber rides Java SDK. The networking stack for the Uber SDK is powered by Retrofit 2 and the same model of threading is available.

Sync

Response<UserProfile> response = service.getUserProfile().execute();
if (response.isSuccessful()) {
    //Success
    UserProfile profile = response.body();
} else {
    //Failure
    ApiError error = ErrorParser.parseError(response);
}

Async

service.getUserProfile().enqueue(new Callback<UserProfile>() {
    @Override
    public void onResponse(Call<UserProfile> call, Response<UserProfile> response) {
        if (response.isSuccessful()) {
            //Success
            UserProfile profile = response.body();
        } else {
            //Api Failure
            ApiError error = ErrorParser.parseError(response);
        }
    }

    @Override
    public void onFailure(Call<UserProfile> call, Throwable t) {
        //Network Failure
    }
});

Samples for Common Calls

Use the Java classes in the samples folder to test standard requests. Alternatively, you can download a sample from the releases page to try them out.

For full documentation, visit our Developer Site.

Get available products

// Get a list of products for a specific location in GPS coordinates, example: 37.79f, -122.39f.
Response<List<Product>> response = service.getProducts(37.79f, -122.39f).execute();
List<Product> products = response.body();
String productId = products.get(0).getProductId();

Request a ride

// Request an Uber ride by giving the GPS coordinates for pickup and drop-off.
RideRequestParameters rideRequestParameters = new RideRequestParameters.Builder().setPickupCoordinates(37.77f, -122.41f)
       .setProductId(productId)
       .setDropoffCoordinates(37.49f, -122.41f)
       .build();
Ride ride = service.requestRide(rideRequestParameters).execute().body();
String rideId = ride.getRideId();

Warning: This real-world request can send an Uber driver to the specified start location. To develop and test against endpoints in a sandbox environment, instantiate your UberRidesService with a Session whose Environment is set to SANDBOX. This will take an existing session and generate a new one pointing to SANDBOX.

SessionConfiguration config = existingConfig.newBuilder().setEnvironment(Environment.SANDBOX).build()

CredentialsSession session = new CredentialsSession(config, credential));
RidesService service = UberRidesApi.with(session);

See our documentation to learn more about the sandbox environment.

Update a ride in the sandbox

If you request a ride in the sandbox, you can step through the different states of the ride.

SandboxRideRequestParameters rideParameters = new SandboxRideRequestParameters.Builder().setStatus(“accepted”).build();
Response<Void> response = service.updateSandboxRide(rideId, rideParameters).execute();

A successful update returns a 204 for response.code().

Note: The updateSandboxRide method is not valid in the PRODUCTION Environment, where the ride status changes automatically. In a PRODUCTION Environment, the call will fail.

Getting Help

Uber developers actively monitor the uber-api tag on StackOverflow. If you need help installing or using the library, ask a question there. Make sure to tag your question with uber-api and java!

Migrating from a previous version

As the Uber SDK get closer to a 1.0 release, the API's will become more stable. In the meantime, be sure to check out the changelog to know what differs!

Contributing

We ❤️ contributions. If you find a bug in the library or would like to add new features, go ahead and open issues or pull requests against this repo. Before you do so, please sign the Uber CLA. Also, be sure to write a test for your bug fix or feature to show that it works as expected.

rides-java-sdk's People

Contributors

alibitek avatar dev-nexonia avatar edjiang avatar itstexter avatar jedrz avatar kp96 avatar lalwani avatar tyvsmith avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rides-java-sdk's Issues

JsonDataException in GET products

I'm getting the following exception:

com.squareup.moshi.JsonDataException: Expected a double but was NULL at path $.products[4].price_details.minimum

When doing a GET on, for example, https://sandbox-api.uber.com/v1.2/products?latitude=41.87811&longitude=-87.6298 and also in prod url https://api.uber.com/v1.2/products\?latitude\=41.87811\&longitude\=-87.6298

Seems to be a parsing error, PriceDetail has minimum field as float and the returned JSON contains a null value:

"price_details": {
        "service_fees": [],
        "cost_per_minute": 0.33,
        "distance_unit": "mile",
        "minimum": null,
        "cost_per_distance": 2.25,
        "base": 3.25,
        "cancellation_fee": 5,
        "currency_code": "USD"
      },

This is using 0.6.0 version of the SDK

localization exposure in java sdk?

I couldn't find a way to add the locale/accept-language header for sdk requests. this would be nice to have added, perhaps on your session or something.

Support for Uber Pool

With Uber Pool, some variables returned by the API can be nullable. The SDK should accommodate that.

Update Scope class

The scope class provides an ENum of available scopes. It lists PAYMENT_METHOD and RIDE_WIDGETS. However, these scopes are not documented here.

Improved Error Handling

Right now, the retrofit2 lib returns a response that could have failed, for instance by mixing up server_token and OAuth authentication methods. Getting an understandable error is not as easy as it could be:

Response<UserProfile> response = service.getUserProfile().execute();
        if (response.isSuccessful()) {
            // Success
            UserProfile profile = response.body();
            System.out.println(profile.toString());
        } else {
            // Failure
            ApiError error = ErrorParser.parseError(response);
            List<ClientError> errors = error.getClientErrors();
            // show error code and message
            for (int i = 0; i < errors.size(); i++) {
                System.out.println(error.getClientErrors().get(i).getStatus() + " "
                        + error.getClientErrors().get(i).getCode() + ": " + error.getClientErrors().get(i).getTitle());
            }
        }

Every user would need to loop through the whole error list. A simple method would be helpful.

/v1.2/requests/current returns curly braces for driver number

Hello team,

We recently ran into an issue when making the API call to /v1.2/requests/current via RidesService.getCurrentRide(). It seems the driver number sometimes return curly braces {} instead of String or null. Below is a scrubbed payload we received:

{
  "status": "in_progress",
  "product_id": "productId",
  "destination": {
    "latitude": 51.5405,
    "alias": "Home",
    "eta": 1,
    "longitude": -0.1336
  },
  "driver": {
    "phone_number": {},
    "rating": 4.92,
    "picture_url": "driverPhotoUrl",
    "name": "DriverName",
    "sms_number": null
  },
  "pickup": {
    "latitude": 51.5374,
    "region": {
      "latitude": 51.5126,
      "country_name": "United Kingdom",
      "country_code": "GB",
      "name": "London",
      "longitude": -0.1304
    },
    "longitude": -0.1414
  },
  "request_id": "requestId",
  "location": null,
  "vehicle": {
    "make": "vehicleMake",
    "picture_url": "vehicleUrl",
    "model": "vehicleModel",
    "license_plate": "licensePlate"
  },
  "shared": false
}

Here is the exception:

PlatformExceptionMapper:handleRuntimeException Unexpected runtime exception:
com.squareup.moshi.JsonDataException: Expected a string but was BEGIN_OBJECT at path $.driver.phone_number
	at com.squareup.moshi.BufferedSourceJsonReader.nextString(BufferedSourceJsonReader.java:592) ~[moshi-1.2.0.jar!/:?]
	at com.squareup.moshi.StandardJsonAdapters$10.fromJson(StandardJsonAdapters.java:203) ~[moshi-1.2.0.jar!/:?]
	at com.squareup.moshi.StandardJsonAdapters$10.fromJson(StandardJsonAdapters.java:201) ~[moshi-1.2.0.jar!/:?]
	at com.squareup.moshi.JsonAdapter$1.fromJson(JsonAdapter.java:68) ~[moshi-1.2.0.jar!/:?]
	at com.squareup.moshi.ClassJsonAdapter$FieldBinding.read(ClassJsonAdapter.java:197) ~[moshi-1.2.0.jar!/:?]
	at com.squareup.moshi.ClassJsonAdapter.fromJson(ClassJsonAdapter.java:159) ~[moshi-1.2.0.jar!/:?]
	at com.squareup.moshi.JsonAdapter$1.fromJson(JsonAdapter.java:68) ~[moshi-1.2.0.jar!/:?]
	at com.squareup.moshi.ClassJsonAdapter$FieldBinding.read(ClassJsonAdapter.java:197) ~[moshi-1.2.0.jar!/:?]
	at com.squareup.moshi.ClassJsonAdapter.fromJson(ClassJsonAdapter.java:159) ~[moshi-1.2.0.jar!/:?]
	at com.squareup.moshi.JsonAdapter$1.fromJson(JsonAdapter.java:68) ~[moshi-1.2.0.jar!/:?]
	at com.squareup.moshi.JsonAdapter.fromJson(JsonAdapter.java:33) ~[moshi-1.2.0.jar!/:?]
	at retrofit2.converter.moshi.MoshiResponseBodyConverter.convert(MoshiResponseBodyConverter.java:32) ~[converter-moshi-2.0.2.jar!/:?]
	at retrofit2.converter.moshi.MoshiResponseBodyConverter.convert(MoshiResponseBodyConverter.java:23) ~[converter-moshi-2.0.2.jar!/:?]
	at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:223) ~[retrofit-2.5.0.jar!/:?]
	at retrofit2.OkHttpCall.execute(OkHttpCall.java:186) ~[retrofit-2.5.0.jar!/:?]
...

We are using Spring Boot 5.1.8, SDK v0.8.0.

NPE for wrong clientSecret during TokenAccess

It was not showing correct message for wrong clientSecret rather throwing NPE. When i checked in code If response is not 200 then you are parsing it to TokenResponseException . You are creating instance of TokenResponseException by using response.getContent() and failing in JsonParser(below is code) because content is returning null .
public JsonParser createJsonParser(InputStream in, Charset charset) throws IOException { Preconditions.checkNotNull(in);
return new JacksonParser(this, this.factory.createJsonParser(in)); }
SS attached.

More Details:
http://stackoverflow.com/questions/41012392/unauthorized-error-in-uber-token-api
response

java sdk payment-method throwing exception

Hi,
I am using v2 sdk to connect to uber. Below is my code snippet to get the payment-methods. I am getting exception at the first line of the below snippet.

Response<PaymentMethodsResponse> paymentMethodResponseRe = uberRidesService.getPaymentMethods(); PaymentMethodsResponse paymentMethodResponse = paymentMethodResponseRe.getBody(); List<PaymentMethod> paymentMethods = paymentMethodResponse.getPaymentMethods();

Below exception while fetching payment-methods for user.

Error 2016-03-02 23:14:30,094 [http-bio-80-exec-1] ERROR errors.GrailsExceptionResolver - IllegalStateException occurred when processing request: [GET] /paymentMethods
Expected a string but was BEGIN_OBJECT at line 1 column 103 path $.payment_methods[0].description. Stacktrace follows:
Message: Expected a string but was BEGIN_OBJECT at line 1 column 103 path $.payment_methods[0].description
Line | Method
->> 837 | nextString in com.google.gson.stream.JsonReader


| 358 | read in com.google.gson.internal.bind.TypeAdapters$13
| 346 | read . . . . . in ''
| 103 | read in com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1
| 196 | read . . . . . in com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter
| 40 | read in com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper
| 81 | read . . . . . in com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter
| 60 | read in ''
| 103 | read . . . . . in com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1
| 196 | read in com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter
| 810 | fromJson . . . in com.google.gson.Gson
| 775 | fromJson in ''
| 63 | fromBody . . . in retrofit.converter.GsonConverter
| 367 | invokeRequest in retrofit.RestAdapter$RestHandler
| 220 | access$100 . . in ''
| 278 | obtainResponse in retrofit.RestAdapter$RestHandler$2
| 42 | run . . . . . in retrofit.CallbackRunnable
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
| 94 | run in retrofit.Platform$Base$2$1
^ 745 | run . . . . . in java.lang.Thread

Error during creation Uber API service object

UberRidesSyncService service = UberRidesServices.createSync(session); I'm catching the java.lang.NoSuchMethodError. Can someone help? jdk1.8.0_73

Exception in thread "main" java.lang.NoSuchMethodError: com.squareup.okhttp.OkHttpClient.setFollowRedirects(Z)V
at com.uber.sdk.rides.client.internal.RetrofitUberRidesClient.buildRestAdapter(RetrofitUberRidesClient.java:147)
at com.uber.sdk.rides.client.internal.RetrofitUberRidesClient.getUberApiService(RetrofitUberRidesClient.java:102)
at com.uber.sdk.rides.client.internal.RetrofitUberRidesClient.getUberApiService(RetrofitUberRidesClient.java:77)
at com.uber.sdk.rides.client.UberRidesServices.create(UberRidesServices.java:182)
at com.uber.sdk.rides.client.UberRidesServices.access$100(UberRidesServices.java:66)
at com.uber.sdk.rides.client.UberRidesServices$Builder.build(UberRidesServices.java:131)
at com.uber.sdk.rides.client.UberRidesServices.createSync(UberRidesServices.java:153)
at uber.UberController.(UberController.java:44)
at uber.UberController.getInstance(UberController.java:82)
at uber.UberController.main(UberController.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)

Add missing endpoints

I doubled checked which methods are provided by the SDK compared to the documentation. The SDK lacks the following:

  • [PATCH] /v1/requests/current
  • [GET] /v1/requests/{request_id}/receipt
  • [POST] /v1/reminders
  • [GET] /v1/reminders/{reminder_id}
  • [PATCH] /v1/reminders/{reminder_id}
  • [DELETE] /v1/reminders/{reminder_id}

Overview

HTTP Method Endpoint Auth Method Required Scope Method
GET /v1/products OAuth or server_token getProducts
GET /v1/products/{product_id} OAuth or server_token getProduct
PUT /v1/sandbox/products/{product_id} OAuth or server_token (Sandbox mode) updateSandboxProduct
GET /v1/estimates/price OAuth or server_token getPriceEstimates
GET /v1/estimates/time OAuth or server_token getPickupTimeEstimate
GET /v1.2/history OAuth history or history_lite getUserActivity
GET /v1/me OAuth profile getUserProfile
POST /v1/requests OAuth request (privileged) requestRide
GET /v1/requests/current OAuth request (privileged) or all_trips (privileged) getCurrentRide
PATCH /v1/requests/current OAuth request (privileged) X
DELETE /v1/requests/current OAuth request (privileged) cancelCurrentRide
POST /v1/requests/estimate OAuth request (privileged) estimateRide
GET /v1/requests/{request_id} OAuth request (privileged) getRideDetails
PATCH /v1/requests/{request_id} OAuth request (privileged) updateRide
PUT /v1/sandbox/requests/{request_id} OAuth request (privileged & Sandbox mode ) updateSandboxRide
DELETE /v1/requests/{request_id} OAuth request (privileged) cancelRide
DELETE /v1/requests/current OAuth request (privileged) cancelCurrentRide
GET /v1/requests/{request_id}/map OAuth request (privileged) getRideMap
GET /v1/requests/{request_id}/receipt OAuth request_receipt (privileged) X
GET /v1/places/{place_id} OAuth places getPlace
PUT /v1/places/{place_id} OAuth places setPlace
GET v1/payment-methods OAuth request (privileged) getPaymentMethods
POST /v1/reminders server_token X
GET /v1/reminders/{reminder_id} server_token X
PATCH /v1/reminders/{reminder_id} server_token X
DELETE /v1/reminders/{reminder_id} server_token X

Refactor SDK into three SDKs

Move the SDK binary into core-uber, core-rides, and core-uber-oauth-client-adapter to allow proper dependency consumption by downstream projects (ie Android SDK).

Required Product find ProductResponse

RidesService service;
service = UberRidesApi.with(session).build().createService();
Having error on below line:
Response<List> response = service.getProducts(37.79f, -122.39f).execute();

default to Environment.SANDBOX

I think Environment.SANDBOX should be used by default, when no environment is set.
I have just made a real request by mistake (my mistake) of omitting the environment.
That would not have happened If it was set by default to SANDBOX.

Getting exeption while retrivin prices

Code snippet used:

`// Create or load a credential for the user.
Credential credential = authenticate(System.getProperty("user.name"));
// Create session for the user
Session session = new Session.Builder().setCredential(credential).setEnvironment(Session.Environment.PRODUCTION).build();
// Create the Uber API service object once the User is authenticated
UberRidesSyncService uberRidesService = UberRidesServices.createSync(session);
// Fetch the user's profile.
System.out.println("Calling API to get the user's profile");
UserProfile userProfile = uberRidesService.getUserProfile().getBody();
System.out.printf("Logged in as %s%n", userProfile.getEmail());
ProductsResponse products = uberRidesService.getProducts(12.960325f, 77.643201f).getBody();
for (Product product : products.getProducts()) {
System.out.println(product.getProductId() + ": " + product.getDisplayName());
}

    Response<PriceEstimatesResponse> fd = uberRidesService.getPriceEstimates(12.960325f, 77.643201f, 12.913017f, 77.589837f);
    List<PriceEstimate> prs = fd.getBody().getPrices();
    while (true) {
        for (Iterator iterator = prs.iterator(); iterator.hasNext();) {
            PriceEstimate priceEstimate = (PriceEstimate)iterator.next();
            System.out.println(priceEstimate.getDisplayName() + " " + priceEstimate.getEstimate());
            Thread.sleep(1000 * 60);
        }
    }`

After running getting exception like
2016-05-17 14:53:00.894:INFO::Logging to STDERR via org.mortbay.log.StdErrLog 2016-05-17 14:53:00.895:INFO::jetty-6.1.26 2016-05-17 14:53:00.911:INFO::Started SocketConnector@localhost:8181 2016-05-17 14:53:00.961:INFO::Stopped SocketConnector@localhost:8181 Calling API to get the user's profile Logged in as [email protected] d7ecf694-0b83-40b1-ad7c-21f5682d98c4: uberMOTO 3eb15796-edd3-4297-80f1-02605442bb9e: uberPOOL db6779d6-d8da-479f-8ac7-8068f4dade6f: uberGO ed5e79f0-c124-4377-89eb-511cbdeb5fe2: POOL 0dfc35e0-b4be-49a1-b1bf-0bc7217e4b58: uberX 1cfdf145-9e9f-44d6-8f93-976e0252ca8d: uberXL Exception in thread "main" java.lang.RuntimeException: retrofit.converter.ConversionException: com.google.gson.JsonSyntaxException: java.lang.NumberFormatException: Expected an int but was 109.11 at line 1 column 338 path $.prices[1].high_estimate at com.google.common.base.Throwables.propagate(Throwables.java:160) at com.uber.sdk.rides.client.internal.RetrofitAdapter.transformFuture(RetrofitAdapter.java:611) at com.uber.sdk.rides.client.internal.RetrofitAdapter.getPriceEstimates(RetrofitAdapter.java:164) at ubertest.GetUserProfile.main(GetUserProfile.java:72) Caused by: retrofit.converter.ConversionException: com.google.gson.JsonSyntaxException: java.lang.NumberFormatException: Expected an int but was 109.11 at line 1 column 338 path $.prices[1].high_estimate at retrofit.converter.GsonConverter.fromBody(GsonConverter.java:67) at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:367) at retrofit.RestAdapter$RestHandler.access$100(RestAdapter.java:220) at retrofit.RestAdapter$RestHandler$2.obtainResponse(RestAdapter.java:278) at retrofit.CallbackRunnable.run(CallbackRunnable.java:42) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at retrofit.Platform$Base$2$1.run(Platform.java:94) at java.lang.Thread.run(Thread.java:745) Caused by: com.google.gson.JsonSyntaxException: java.lang.NumberFormatException: Expected an int but was 109.11 at line 1 column 338 path $.prices[1].high_estimate at com.google.gson.internal.bind.TypeAdapters$7.read(TypeAdapters.java:249) at com.google.gson.internal.bind.TypeAdapters$7.read(TypeAdapters.java:239) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:116) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:216) at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40) at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:82) at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:116) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:216) at com.google.gson.Gson.fromJson(Gson.java:879) at com.google.gson.Gson.fromJson(Gson.java:844) at retrofit.converter.GsonConverter.fromBody(GsonConverter.java:63) ... 8 more Caused by: java.lang.NumberFormatException: Expected an int but was 109.11 at line 1 column 338 path $.prices[1].high_estimate at com.google.gson.stream.JsonReader.nextInt(JsonReader.java:1202) at com.google.gson.internal.bind.TypeAdapters$7.read(TypeAdapters.java:247) ... 19 more

JavaDoc for the RidesService & model classes

Understanding which methods are available and how to construct appropriate requests is harder as it could be. An automatically generated JavaDoc would improve navigation.

UPDATE: One idea might be to use GitHub pages in order to make the JavaDoc easily accessible. We could auto-generate the docs with Gradle.

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.