We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, I'm using Retrofit to make paged requests. I need to be able to get paging attributes contained in meta.
The retrofit interface has a call like this:
@GET("appointments?include=service") Call<List<Appointment>> getBusinessAppointments(@HeaderMap Map<String, String> headers, @Query("filter[businessId]") String businessId, @QueryMap Map<String, String> options);
When making the call, I receive the Appointments list but no way of getting the attributes of meta. The response has this format:
{"data":[...],"included":[...],"meta":{"page":{"page":1,"total-entries":10,"total-pages":1,"number":2,"size":30}}}
Is there any way of getting the 'total-entries' and 'size' params?
The text was updated successfully, but these errors were encountered:
The getMeta() returns a JsonBuffer object (https://github.com/kamikat/moshi-jsonapi#metalinksjsonapi-properties). There you can create a JsonAdapter as is described in https://github.com/square/moshi and pass it to JsonBuffer.get to get the object.
getMeta()
JsonBuffer
JsonAdapter
JsonBuffer.get
Sorry, something went wrong.
@kamikat how can you getMeta on the Document rather than each Object? As long as in this example the result is List
No branches or pull requests
Hi,
I'm using Retrofit to make paged requests. I need to be able to get paging attributes contained in meta.
The retrofit interface has a call like this:
@GET("appointments?include=service") Call<List<Appointment>> getBusinessAppointments(@HeaderMap Map<String, String> headers, @Query("filter[businessId]") String businessId, @QueryMap Map<String, String> options);
When making the call, I receive the Appointments list but no way of getting the attributes of meta.
The response has this format:
{"data":[...],"included":[...],"meta":{"page":{"page":1,"total-entries":10,"total-pages":1,"number":2,"size":30}}}
Is there any way of getting the 'total-entries' and 'size' params?
The text was updated successfully, but these errors were encountered: