Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

could not be mapped to a JSON object. Perhaps it hasn't been annotated with @JsonObject #158

Open
ntimesc opened this issue Apr 29, 2016 · 1 comment

Comments

@ntimesc
Copy link

ntimesc commented Apr 29, 2016

i am trying to fetch data from Realm and sending it to server using retrofit and for parsing and serializing i am using LoganSquare

  client =  new Retrofit.Builder()
                         .baseUrl(REST_ENDPOINT)
                         .client(okHttpClient)
                         .addConverterFactory(LoganSquareConverterFactory.create())
                         .build();

this is how i am accessing record

Appointment appointments = DB.getInstance(mContext).selectNotSyncAppointmentsData();
        RestApi.AppointmentsDataApi service = getAppointmentsDataApi();
        Call<APResponse> call = service.createUpdateAppointmentsData(appointments);

i am getting following error

createUpdateAppointmentData : onFailure Class io.realm.AppointmentRealmProxy could not be mapped to a JSON object. Perhaps it hasn't been annotated with @JsonObject?
@mannodermaus
Copy link
Contributor

mannodermaus commented Apr 29, 2016

LoganSquare requires all model classes to be annotated with @JsonObject, and Realm's proxy classes aren't, hence why you get this error. We'd have to look into how Realm support can be added on top of the library core. Could you provide a minimal example project with Realm set up that demonstrates the issue? With that as a starting point, maybe we can implement support for the proxy classes in the near future!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants