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

[BUG] The incorrect splicing of the GitHub API results in empty data from the request. #243

Open
jixiaoyong opened this issue Dec 20, 2023 · 1 comment

Comments

@jixiaoyong
Copy link

Hey there, I recently tried the demo codelab-android-paging/tree/main/advanced/start, and found the list always empty, according to the latest official document the reason is the apiQuery used in both start and end project missed a + between query and IN_QUALIFIER:

as in the start project:

IN_QUALIFIER:

apiQuery:

Same code in [codelab-android-paging/tree/main/advanced/end](https://github.com/android/codelab-android-paging/tree/main/advanced/end)

if we input a query as "Android", the final network request URL will be "https://api.github.com/search/repositories?sort=stars&q=Androidin%3Aname%2Cdescription&page=1&per_page=30"

and the result:

{
  "total_count": 0,
  "incomplete_results": false,
  "items": [
    
  ]
}

after we add a + :

"https://api.github.com/search/repositories?sort=stars&q=Android%2Bin%3Aname%2Cdescription&page=1&per_page=30"

and the result:

{
    "total_count": 64,
    "incomplete_results": false,
    "items": [
        ...
    ]
}
jixiaoyong added a commit to jixiaoyong/codelab-android-paging that referenced this issue Dec 20, 2023
@diegocarloslima
Copy link

another option, is to have a space between the query and the IN_QUALIFIER:

val apiQuery = "$query $IN_QUALIFIER"

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