KnpLabs / KnpLabs/php-github-api

RequestInterface shows invalid URI

未关闭
#611 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
PHP
星标
2.2k
派生
587
PR 合并指标
30 天内没有已合并 PR

描述

I'm, always getting the `"Not found"` error on my api calls. Tried investigating and found this on the $request passed to the `RequestInterface::sendRequest()` method:

```
Request {#346 ▼
-method: "GET"
-requestTarget: null
-uri: Uri {#347 ▼
-scheme: ""
-userInfo: ""
-host: ""
-port: null
-path: "/user/repos"
-query: "type=owner&sort=full_name&direction=asc"
-fragment: ""
}
-headers: []
-headerNames: []
-protocol: "1.1"
-stream: null
}
```

Seems like the `path` parameter is missing some parameters even though $`github->currentUser()->show()` shows a complete response:

```
array:30 [▼
"login" => "myusername"
"id" => xxxxxxxxx
"avatar_url" => "https://avatars2.githubusercontent.com/u/xxxxxxxxx?v=3"
"gravatar_id" => ""
"url" => "https://api.github.com/users/myusername"
"html_url" => "https://github.com/myusername"
"followers_url" => "https://api.github.com/users/myusername/followers"
"following_url" => "https://api.github.com/users/myusername/following{/other_user}"
"gists_url" => "https://api.github.com/users/myusername/gists{/gist_id}"
"starred_url" => "https://api.github.com/users/myusername/starred{/owner}{/repo}"
"subscriptions_url" => "https://api.github.com/users/myusername/subscriptions"
"organizations_url" => "https://api.github.com/users/myusername/orgs"
"repos_url" => "https://api.github.com/users/myusername/repos"
"events_url" => "https://api.github.com/users/myusername/events{/privacy}"
"received_events_url" => "https://api.github.com/users/myusername/received_events"
"type" => "User"
"site_admin" => false
"name" => "My Name"
"company" => null
"blog" => "http://www.myusername.com"
"location" => null
"email" => "myusername@gmail.com"
"hireable" => true
"bio" => null
"public_repos" => 4
"public_gists" => 0
"followers" => 0
"following" => 0
"created_at" => "2013-03-05T03:52:44Z"
"updated_at" => "2017-06-28T06:59:13Z"
]
```

贡献指南

这个仓库没有索引到贡献指南

调研方向

Start at RequestInterface::sendRequest() and inspect how the Request and Uri values shown in the report are assembled for the user-repositories call. Reproduce the API request and compare the resulting URI with the endpoint represented by the current-user response; done means the request no longer produces the reported "Not found" error.

由索引模型根据 Issue 内容生成。

评估

技术栈
php
领域
api
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。