use of com.github.jasminb.jsonapi.retrofit.JSONAPIConverterFactory in project open-event-android by fossasia.
the class APIClient method getOpenEventAPI.
public static OpenEventAPI getOpenEventAPI() {
if (openEventAPI == null) {
OkHttpClient okHttpClient = okHttpClientBuilder.addInterceptor(new HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BASIC)).authenticator(AuthUtil.getAuthenticator()).build();
ObjectMapper objectMapper = getObjectMapper();
Class[] classes = { Event.class, Track.class, Speaker.class, Sponsor.class, Session.class, Microlocation.class, User.class, FAQ.class, Notification.class, DiscountCode.class };
openEventAPI = new Retrofit.Builder().client(okHttpClient).addCallAdapterFactory(RxJava2CallAdapterFactory.create()).addConverterFactory(new JSONAPIConverterFactory(objectMapper, classes)).addConverterFactory(JacksonConverterFactory.create(getObjectMapper())).baseUrl(Urls.BASE_URL).build().create(OpenEventAPI.class);
}
return openEventAPI;
}
Aggregations