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

issues&pull request接口问题 #63

Open
dyljqq opened this issue Oct 24, 2022 · 1 comment
Open

issues&pull request接口问题 #63

dyljqq opened this issue Oct 24, 2022 · 1 comment

Comments

@dyljqq
Copy link
Owner

dyljqq commented Oct 24, 2022

GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the pull_request key. Be aware that the id of a pull request returned from "Issues" endpoints will be an issue id. To find out the pull request id, use the "List pull requests" endpoint.

诚如接口所说,所有的pull都可以看成是一个issue,并且number就是issue的number。但是issues的这个接口给的过滤参数pulls,为boolean值。目前传入所有的true,yes,1。都无法更改结果。因此目前是用的pulls接口来获取pull的数据。这就会导致comments的取值无法获得。

如果有知道怎么过滤的朋友,麻烦告知一下。

@dyljqq
Copy link
Owner Author

dyljqq commented Oct 25, 2022

现在能想到的办法就是队issues的返回数据做一个过滤。如果这个issue是一个pull request的话,那么返回的结构体里面就会出现pull_request字段。通过这个去做过滤。

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

1 participant