KnpLabs / KnpLabs/php-github-api

Error when adding a label to an issue

未關閉
#1,035 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
PHP
星號
2.2k
分支
587
PR 合併指標
30 天內沒有已合併 PR

描述

Hello,

I have an error when I try to add a label on an issue, following [this documentation](https://github.com/KnpLabs/php-github-api/blob/master/doc/issue/labels.md#add-a-label-on-an-issue).

Here is how I do it:

```php
$labels = $client->api('issue')->labels()->add('matthieu-rolland', 'test-issuebot', 51, 'Fixed');
```

And here is what I get:

`PHP Fatal error: Uncaught Github\Exception\RuntimeException: Invalid request.
No subschema in "anyOf" matched.
`

When I debug I see that the response I get is actually:

`ERROR 422 Unprocessable Entity`

I didn't manage to identify the cause of this problem...

**Some more information:**

- It does work when I call github's API directly via postman with the same github token
- While debugging I saw that the URI and HTTP methods seem correct (but maybe not until the end?)
- I'm not sure about the request's body
- VERSION 2.12.1

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

Start with the add-a-label example in the linked issue-labels documentation and the PHP call shown for version 2.12.1. Compare the request body and response handling with the successful Postman request; done means adding the label no longer produces the 422 Invalid request error.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
github, php
領域
api
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。