fastai / ghapi

A delightful and complete interface to GitHub's amazing API
https://ghapi.fast.ai/
Apache License 2.0
626 stars 65 forks source link

search query encoding not working #149

Open bob-rohan opened 2 years ago

bob-rohan commented 2 years ago

This works

curl -v \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer $GH_ENTERPRISE_TOKEN" \
  https://$GH_HOST/api/v3/search/issues\?q\=repo:$REPO_NAME+state:open\&per_page=30\&page=

This does not

from ghapi.all import *
api = GhApi(<token etc..>)
paged(api.search.issues_and_pull_requests, q="repo:<REPO_NAME> state:open')

For debug log debug=print_summary

https://<HOST>/api/v3/search/issues?q=repo%3A<OWNER>%2F<REPO>+state%3Aopen&per_page=30&page=1

See : was replaced with %3A. This I think is what breaks the query, some uri/url encoding happening somewhere

bob-rohan commented 2 years ago

NB whitespace replaced with + was also not intuative, found this on some go forum and happened to work. But can't workaround the colon issue