-
Notifications
You must be signed in to change notification settings - Fork 41
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
Query gets only first row #7
Comments
If i do the same request in browser it returns csv with all rows |
I ran into the same issue (following the simple use case described in the readme / tutorial), the CSV contains all the data but when converting to JSON, the library tries to treat it as an object instead of a list. |
I don't know how I missed this issue. Didn't see. Let me check the scenario. I'll keep you posted here. Thanks for reporting this issue |
@timkabot @pandulapeter |
@theapache64 Thanks for looking into this! I just tried updating to the latest version (2.0.0-alpha02) but unfortunately I ran into the same issue for my use case. Instead of an array l keep getting a single object in the JSON. Here's the Google Sheet I'm using and some relevant (and admittedly over-engineered) code:
Do you see anything wrong with this setup? Note that I did manage to solve this problem for my use case, by simply copying over your library and modifying one thing: in the If you want to quickly reproduce the issue, clone this project and modify the |
@pandulapeter I've copied your code and I am surprised it works for me. Can you pull |
Something weird is going on here :) I pulled the branch you mentioned and it was working fine for me as well. Let's print both API calls and enable logging for the library: Note the array - we're good. Then I copied the library code from this branch to my Android app linked above, and enabled logging there as well. This is the output from the Android app: No array there. Using the exact same code. Looks like this |
@pandulapeter Can you tell me your retrofit version ? |
Should be the latest, 2.9.0. |
Weird, am also using the same version. 🤔 Let me try with Android then |
@pandulapeter I found that the Android implementation of To fix this issue, I've added a new annotation named import com.github.theapache64.retrosheet.core.Read
import com.github.theapache64.retrosheet.core.ReadAsList
import retrofit2.http.GET
internal interface NetworkingService {
@ReadAsList // The New Annotation
@Read("SELECT *")
@GET(NozzleTypeResponse.SHEET_NAME)
suspend fun getNozzleTypes(): List<NozzleTypeResponse>
@ReadAsList // The New Annotation
@Read("SELECT *")
@GET(NozzleStubResponse.SHEET_NAME)
suspend fun getNozzles(): List<NozzleStubResponse>
} You'll need to upgrade to |
Works like a charm 👍 Thanks for the fix and for the awesome library! |
You're welcome 🙇 |
I realized simple example for samples.
with this table
But the query returns only single object which is always first row
The text was updated successfully, but these errors were encountered: