Skip to content

Retrofit update

Compare
Choose a tag to compare
@ctmay4 ctmay4 released this 23 Nov 13:52

This release migrates to the 2.0 release of Retrofit. This is a pretty large change to the API, but will allow more advanced uses cases in the future, like HATEOAS support. All API calls now return a Call object. Previously a call looked like:

StagingSchema schema = api.staging().schemaById("cs", "02.05.50", "brain");

Now it will look like this:

Call<StagingSchema> call = api.staging().schemaById("cs", "02.05.50", "brain");
call.execute();
StagingSchema schema = call.body();

or it can be simplified into a single line

StagingSchema schema = api.staging().schemaById("cs", "02.05.50", "brain").execute().body();

If there is a non-200 return value then an exception will be thrown (i.e. NotAuthorizedException, 'NotFoundException,BadRequestException`, etc).