fastai / ghapi

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

search query encoding not working #149

Open bob-rohan opened 1 year ago

bob-rohan commented 1 year 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 1 year 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