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
When i try to search against the Github api using the github example i get an 422 error.
In go code this looks like:
opt := &github.SearchOptions{Sort: "updated"} client.Search.Code("addClass+in:file+language:js+repo:jquery/jquery", opt)
The error looks like:
error: GET https://api.github.com/search/code?q=addClass%2Bin%3Afile%2Blanguage%3Ajs%2Brepo%3Ajquery%2Fjquery&sort=updated: 422 Validation Failed [{Resource:Search Field:q Code:invalid}]
The Problem is that go encodes the query string and not only the params. The Github Api isn't able to deal with such queries.
Go generated url:
$ curl https://api.github.com/search/code?q=addClass%2Bin%3Afile%2Blanguage%3Ajs%2Brepo%3Ajquery%2Fjquery&sort=updated
=> does not work
Same curl without encoding:
$ curl https://api.github.com/search/code?addClass+in:file+language:js+repo:jquery/jquery&sort=updated
=> works
We will prepare a pullrequest for this issue.
The text was updated successfully, but these errors were encountered:
rather than separating search operators by literal + characters, try spaces:
+
opt := &github.SearchOptions{Sort: "updated"} client.Search.Code("addClass in:file language:js repo:jquery/jquery", opt)
I think that should work. If so, then the problem is really one of documenting that better.
Sorry, something went wrong.
I've been making very complex search queries with space separators. It's definitely a documentation thing.
Great, thank you :)
No branches or pull requests
When i try to search against the Github api using the github example i get an 422 error.
In go code this looks like:
The error looks like:
The Problem is that go encodes the query string and not only the params.
The Github Api isn't able to deal with such queries.
Go generated url:
=> does not work
Same curl without encoding:
=> works
We will prepare a pullrequest for this issue.
The text was updated successfully, but these errors were encountered: